Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Reinventing time...need help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ecookman




PostPosted: Thu Jun 04, 2009 8:21 pm   Post subject: Reinventing time...need help

What is it you are trying to achieve?
For about 3 months now I have been hating the 24h based time system we use. I have decided to reinvent time. I want to make it so 12h=1h thus there are only 2 hours in one day. From here i will convert the minutes and seconds.


What is the problem you are having?
I am not quite sure on how to do the conversions and rework my countdown timer so it tells a converted time.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
here is my countdown timer.

Turing:


var christmas : string := "25 Dec 08 00:00:00"
loop
var totalseconds : int := Time.DateSec (christmas) -Time.DateSec (Time.Date)
var days, hours, mins, secs : int


days := totalseconds div 86400
totalseconds:=totalseconds-days*86400

hours := totalseconds div 3600
totalseconds:=totalseconds-hours*3600

mins := totalseconds div 60
totalseconds:=totalseconds-mins*60

secs := totalseconds

var total :int := days*86400+hours*3600+mins*60+secs



var f1 :int := Font.New ("Airil:40:bold")
   
    colorback (black)
    color (brightgreen)
    Font.Draw (intstr (days) + " DAYS", maxx div 4, 275 ,f1, brightgreen)
    Font.Draw (intstr (hours) + " HOURS", maxx div 4, 200, f1, brightgreen)
    Font.Draw (intstr (mins) + " MINUITES", maxx div 4, 125, f1, brightgreen)
    Font.Draw (intstr (secs) + " SECONDS", maxx div 4, 50, f1, brightgreen)
    delay (1000)
    cls
end loop




Please specify what version of Turing you are using
4.1.0
Sponsor
Sponsor
Sponsor
sponsor
ecookman




PostPosted: Sat Jun 06, 2009 2:15 pm   Post subject: RE:Reinventing time...need help

bump?
apomb




PostPosted: Sat Jun 06, 2009 2:20 pm   Post subject: RE:Reinventing time...need help

Firstly: Dont bump threads

Secondly: you'd have to have the counter counting and simply set the display to change every 12h instead of changing every second, or minute, or whatever incriment you want. so basically, its not a matter of
changing the countdown, its a matter of changing the output.
ecookman




PostPosted: Sat Jun 06, 2009 2:24 pm   Post subject: RE:Reinventing time...need help

Confused what?

I am not sure what you mean by change the output...don't I have to get rid of the counting down part. and have it just count time.
apomb




PostPosted: Sat Jun 06, 2009 2:37 pm   Post subject: RE:Reinventing time...need help

Ok, yes, i thought you wanted to change that countdown timer into a countdown timer that counts down in 2h days... if you just want to have a 2h/day clock, yes, all you would need was to have it just count time, and every 12h, change the hour. the minutes would be a bit trickier, but not too difficult. There would be 120 "minutes" in your 2h day. Therefore, the minutes would change every 12 minutes. (1440real minutes/120"minutes"). get it?
ecookman




PostPosted: Sat Jun 06, 2009 2:38 pm   Post subject: RE:Reinventing time...need help

ooohhh... thanks I'll start working on it!
apomb




PostPosted: Sat Jun 06, 2009 2:41 pm   Post subject: RE:Reinventing time...need help

No problem, It got me tinking too, im drawing diagrams and things about this now... haha Its an interesting problem.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: