Computer Science Canada

finally...the countdown timer

Author:  ecookman [ Wed Dec 17, 2008 8:26 am ]
Post subject:  finally...the countdown timer

thanks to The_Bean walking me through how to do this here it is


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
f1 := Font.New ("Airil:12:bold")
Font.Draw(intstr(days)+":"+intstr(hours)+":"+intstr(mins)+":"+intstr(secs),maxx div 2,maxy div 2 ,f1, 12)
delay (1000)
cls
end loop




thanks for helping me

***********************EDIT******************
this program only works in turing 4.1.0


: