'By SierraKen on January 27, 2022.
_Title "Digital Time and Date - Click to Listen."
rootpath$
= Environ$("SYSTEMROOT") 'normally "C:\WINDOWS"fontfile$ = rootpath$ + "\Fonts\courbd.ttf" 'TTF file in Windows
style$ = "bold" 'font style is not case sensitive
ballx = 200: bally = 100
redo:
If mouseLeftButton
= -1 And SpeakTime
= 0 Then 'Don't spam speak if the user goes crazy with mouse clicks! mouseLeftButton = 0
SpeakTime = 1 'Set the flag to speak the time.
If SpeakTime
= 1 Then 'Speak the first line StartTimer
= Timer + 4: SpeakTime
= 2 'set the flag to wait 4 seconds before speaking the second line message = "The time is " + hour$ + minute$ + pmam$ + " and " + second$ + " seconds."
speak message
StartTimer
= Timer + 4: SpeakTime
= 3 'wait 4 seconds for the second line to finish. message = "The date today is " + month$ + " " + day$ + " " + year$
speak message
SpeakTime = 0 'we're finished speaking. Allow the user to click the clock again if they want.
_PrintString (10, 10), hour$
+ ":" + minute$
+ ":" + second$
+ pmam$
ball ballx, bally, dx, dy
Sub ball
(ballx
, bally
, dx
, dy
) ballx = ballx + dx
bally = bally + dy
more:
If ballx
> 400 Then dx
= -5: dy
= (Rnd * 5) - 5 If bally
> 200 Then dy
= -5: dx
= (Rnd * 5) - 5
r = 15
cx = ballx
cy = bally
fillCircle cx, cy, r, c
'from Steve Gold standard
Radius
= Abs(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 Line (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
Line (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
Line (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
Line (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
Line (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF
'Windows only, I think
out$
= "Powershell -Command " + Chr$(34) out$
= out$
+ "Add-Type -AssemblyName System.Speech; " out$
= out$
+ "$Speech = New-Object System.Speech.Synthesis.SpeechSynthesizer; " out$
= out$
+ "$Speech.SelectVoice('Microsoft Zira Desktop'); " out$
= out$
+ "$Speech.Speak('" + message
+ "');" + Chr$(34)