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

0 Members and 1 Guest are viewing this topic.

Offline skylas

  • CPC664
  • ***
  • Posts: 73
  • Country: gr
    • AMSTRAD SAKIS
  • 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?
Many thx for your help!

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.418
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 1433
  • Likes Given: 3073


Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.774
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • 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 :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

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

Offline skylas

  • CPC664
  • ***
  • Posts: 73
  • Country: gr
    • AMSTRAD SAKIS
  • 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!