BlitzPlus is a programming language created in 2003.
#4536on PLDB | 21Years Old |
Blitz BASIC refers to the programming language dialect that was interpreted by the first Blitz compilers, devised by New Zealand-based developer Mark Sibly. Being derived from BASIC, Blitz syntax was designed to be easy to pick up for beginners first learning to program. The languages are game-programming oriented but are often found general-purpose enough to be used for most types of application. Read more on Wikipedia...
AppTitle = "Binary Clock"
Graphics 145,85
secondtimer = CreateTimer(2)
Repeat
Hour = CurrentTime()[..2].ToInt()
Minute = CurrentTime()[4..6].ToInt()
Second = CurrentTime()[6..].ToInt()
If Hour >= 12 Then PM = 1
If Hour > 12 Then Hour = Hour - 12
If Hour = 0 Then Hour = 12
'should do this otherwise the PM dot will be
'Left up once the clock rolls past midnight!
Cls
SetColor(0,255,0) 'make the text green For the PM part
If PM = 1 Then DrawText "PM",5,5
'set the text colour back To white For the rest
SetColor(255,255,255)
For bit=0 Until 6
xpos=20*(6-bit)
binaryMask=2^bit
'do hours
If (bit<4)
If (hour & binaryMask)
DrawText "1",xpos,5
Else
DrawText "0",xpos,5
EndIf
EndIf
'do the minutes
If (minute & binaryMask)
DrawText "1", xpos,25
Else
DrawText "0", xpos,25
EndIf
'do the seconds
If (second & binaryMask)
DrawText "1",xpos,45
Else
DrawText "0",xpos,45
EndIf
Next
'make the text red For the decimal time
SetColor(255,0,0)
DrawText "Decimal: " + CurrentTime(),5,65
'set the text back To white For the rest
SetColor(255,255,255)
Flip
'will wait half a second
WaitTimer(secondTimer)
If KeyHit(KEY_ESCAPE) Then Exit
Forever