News:

Welcome to RetroCoders Community

Main Menu

countdown clock program

Started by ron77_db, Apr 02, 2022, 08:07 AM

Previous topic - Next topic

ron77_db

hello...

here is a countdown clock program for days hours minutes seconds using "FBTrueType" lib to show the digit countdown...

this is the source code of the program:
#include "fbgfx.bi"
#include "FBTrueType.bi"

screenres 800,600, 32
width 800\8, 600\16
VAR Font = FontLoad("pocketcalcuatlor.ttf")

Color RGB(255, 128, 0), RGB(0, 0, 64) : cls

dim as long s,m,h,d
input "how many days?: ", d
input "how many hours?: ", h
input "how many minutes?: ", m
input "how many seconds?: ", s

'var dEnd = timer + seconds + minutes*60 + hours*3600 + days*86400
var dEnd = timer + s + m*60 + h*3600 + d*86400


do
	cls
	var iLeftSecond = cint(fix(dEnd-timer))
	dim as string sText = "Days: " & iLeftSecond\86400 & ", Hours: " & ((iLeftSecond\3600) mod 24) & ", Minutes: " & (iLeftSecond\60) mod 60 & ", Seconds: " & iLeftSecond mod 60
	TTPrint Font , 20 , 200 , sText , RGB(255 , 0 , 0) , 50
	if iLeftSecond <= 0 then print "Beep!"
	sleep 1000
loop until inkey = "q

you terminate the program by pressing "q" key

this is what it looks like:
You cannot view this attachment.

and the project program with Windows executable (32 bit) and Linux executable (64 bit) and source files and libraries included:

You cannot view this attachment.