### Author Topic: Create a countdown clock in BASIC  (Read 231 times)

0 Members and 1 Guest are viewing this topic.

#### skylas

• CPC664
• Posts: 73
• Country:
• Liked: 98
• Likes Given: 99
##### Create a countdown clock in BASIC
« on: 16:52, 25 March 20 »
Hello all
I am thinking of creating a new quiz/test, but i need a small feature that i have problem to make.I would like to have a countdown clock, eg starting from 10 seconds that goes to 0 seconds, showing the time left (seconds and 2 decimals) for the player to answer.And of course to be interrupted when the player answers.

As  for the part of waiting the player to answer and taking a bonus based on quick answer, ia have already made that for <Capital quiz> using AFTER AND PRINT REMAIN.The one that i cannot think something is to make the countdown showing in the screen and being interrupted when player answers.
Anyone has a simple way for that?

#### ComSoft6128

• ..................................
• Supporter
• 6128 Plus
• Posts: 1.418
• Country:
• CPC THEN CPC NOW
• Liked: 1433
• Likes Given: 3073
##### Re: Create a countdown clock in BASIC
« Reply #1 on: 17:11, 25 March 20 »

#### skylas

• CPC664
• Posts: 73
• Country:
• Liked: 98
• Likes Given: 99
##### Re: Create a countdown clock in BASIC
« Reply #2 on: 02:19, 26 March 20 »

#### AMSDOS

• Supporter
• 6128 Plus
• Posts: 3.774
• Country:
• Liked: 1021
• Likes Given: 1731
##### Re: Create a countdown clock in BASIC
« Reply #3 on: 12:37, 26 March 20 »
My example uses EVERY and the check is made every second, so I guess to see the Decimal Intervals EVERY 50 can be changed to EVERY 25 to make a check every half second for example or 12.5 for a quarter of a second if you like that .25 interval.

I'm sure if can be done using TIME, but it's a bit late here and I can't do the math, unfortunately I can only List a Screenshot of the Code.
* Using the old Amstrad Languages    * with the Firmware
* I also like to problem solve code in BASIC    * And type-in Type-Ins!

Home Computing Weekly Programs
Popular Computing Weekly Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

#### skylas

• CPC664
• Posts: 73
• Country:
• Liked: 98
• Likes Given: 99
##### Re: Create a countdown clock in BASIC
« Reply #4 on: 20:10, 26 March 20 »
My example uses EVERY and the check is made every second, so I guess to see the Decimal Intervals EVERY 50 can be changed to EVERY 25 to make a check every half second for example or 12.5 for a quarter of a second if you like that .25 interval.

I'm sure if can be done using TIME, but it's a bit late here and I can't do the math, unfortunately I can only List a Screenshot of the Code.
Many thx AMSDOS! is seems it works fine with your proposal!