Computer Science Canada how do i incorporate a timer |
Author: | upandatom [ Mon Jan 17, 2005 5:17 pm ] |
Post subject: | how do i incorporate a timer |
would i use a case statment or just a counter? |
Author: | cycro1234 [ Mon Jan 17, 2005 5:33 pm ] | ||
Post subject: | |||
Theres a code for a small timer. |
Author: | upandatom [ Mon Jan 17, 2005 5:34 pm ] |
Post subject: | |
so if i wanted a program to close after 30 seconds do i for count or ? |
Author: | cycro1234 [ Mon Jan 17, 2005 5:37 pm ] |
Post subject: | |
Change the part where it says 120 seconds to 30 seconds. |
Author: | upandatom [ Mon Jan 17, 2005 5:40 pm ] |
Post subject: | |
here's my code var random3:int randint(random3,1,3) var answer : int var random : int var random2 : int var reply:string loop randint (random, 1, 12) randint (random2, 1, 12) put random ,"*",random2 get answer if answer = random * random2 then put "Caught it" else put "Wrong, deducting money" end if end loop i want the thing to end after 30 seconds and the seconds have to be displayed |
Author: | cycro1234 [ Mon Jan 17, 2005 5:56 pm ] |
Post subject: | |
So try adding the counter, with the 30 seconds limit, inside the loop. |
Author: | upandatom [ Mon Jan 17, 2005 5:58 pm ] |
Post subject: | |
lol i triiied bu tthen i have to wait for the 30 seconds before it starts asking questions or the timer doesnt show at all |
Author: | cycro1234 [ Mon Jan 17, 2005 6:01 pm ] | ||
Post subject: | |||
Better?
|
Author: | cycro1234 [ Mon Jan 17, 2005 6:02 pm ] |
Post subject: | |
Disregard the double code. |
Author: | upandatom [ Mon Jan 17, 2005 8:09 pm ] |
Post subject: | |
ty |
Author: | cycro1234 [ Mon Jan 17, 2005 8:13 pm ] |
Post subject: | |
np |