Range starts at 1, it must!
Angles are in degrees.
Here is Easylang Clock Sim at least the drawing part, I simplified the call to SYStem since QB64 has TIME$ function:
_TITLE "Easylang Sim Output: Clock " 'started 2019-06-06 by B+
DEFSNG A-Z 'everything without Type Suffix will be Single
'setup a graphics screen
CONST xmaxScreen = 400 '<<< constants don't have to be typed
CONST ymaxScreen = 400
SCREEN _NEWIMAGE(xmaxScreen, ymaxScreen, 32) '<<< 32 means to use highest graphics RGBA color system
_SCREENMOVE 300, 100 'put screen approx in middle of display for 1280X760 laptop
'setup globals to do things like easylang does
DIM SHARED sz, cx, cy
DIM SHARED colr AS _UNSIGNED LONG
'on timer
' if t$ <> sys "time"
' t$ = sys "time"
' h$ = sys "time:" & t$
' sec = number substr h$ 17 2
' min = number substr h$ 14 2
' hour = number substr h$ 11 2
' if hour > 12
' hour -= 12
' .
' call draw hour min sec
' timer 0.98
' else
' timer 0.01
' .
'.
'timer 0
'using a timer is too complicated, just get the time, 30 per sec
CLS , &HFFFFFFFF
DO
t$ = TIME$
hour = VAL(MID$(t$, 1, 2))
IF hour > 12 THEN hour = hour - 12
min = VAL(MID$(t$, 4, 2))
sec = VAL(MID$(t$, 7, 2))
drawClock hour, min, sec
_DISPLAY
_LIMIT 30 '<<< loops per sec
LOOP
'func draw hour min sec . . <<< really a sub because no return value
SUB drawClock (hour, min, sec)
' # dial
' color 333
colour 333
' move 50 50
move 50, 50
' circle 45
circul 45
' color 797
colour 797
' circle 44
circul 44
' color 333
colour 333
' for i range 60
FOR i = 1 TO 60
' a# = i * 6
a = i * 6
' move 50 + sin a# * 40 50 - cos a# * 40
move 50 + SIN(_D2R(a)) * 40, 50 - COS(_D2R(a)) * 40
' circle 0.25
circul .25
' .
NEXT
' for i range 12
FOR i = 1 TO 12
' a# = i * 30
a = i * 30
' move 50 + sin a# * 40 50 - cos a# * 40
move 50 + SIN(_D2R(a)) * 40, 50 - COS(_D2R(a)) * 40
' circle 1
circul 1
' .
NEXT
' # hour
' linewidth 2
lineWidth 2
' color 000
colour 0
' a# = (hour * 60 + min) / 2
a = (hour * 60 + min) / 2
' move 50 50
move 50, 50
' line 50 + sin a# * 32 50 - cos a# * 32
lyne 50 + SIN(_D2R(a)) * 32, 50 - COS(_D2R(a)) * 32
' # min
' linewidth 1.5
lineWidth 1.5
' a# = (sec + min * 60) / 10
a = (sec + min * 60) / 10
' move 50 50
move 50, 50
' line 50 + sin a# * 40 50 - cos a# * 40
lyne 50 + SIN(_D2R(a)) * 40, 50 - COS(_D2R(a)) * 40
' # sec
' linewidth 1
lineWidth 1
' color 700
colour 700
' a# = sec * 6
a = sec * 6
' move 50 50
move 50, 50
' line 50 + sin a# * 40 50 - cos a# * 40
lyne 50 + SIN(_D2R(a)) * 40, 50 - COS(_D2R(a)) * 40
'.
END SUB
'set COLOR foreground for drawing or printing text FROM up to 3 digit integer parameter
SUB colour (n AS INTEGER) 'can't use COLOR as is keyword
s3$ = RIGHT$("000" + LTRIM$(STR$(n)), 3)
r = VAL(MID$(s3$, 1, 1)): IF r THEN r = 28 * r + 3
g = VAL(MID$(s3$, 2, 1)): IF g THEN g = 28 * g + 3
b = VAL(MID$(s3$, 3, 1)): IF b THEN b = 28 * b + 3
colr = _RGB32(r, g, b)
END SUB
SUB move (setX, setY)
cx = setX * 4: cy = setY * 4
END SUB
SUB circul (radius)
fcirc cx, cy, 4 * radius, colr
END SUB
SUB lyne (endx, endy)
thic2 cx, cy, 4 * endx, 4 * endy, sz, colr
END SUB
SUB lineWidth (width)
sz = 4 * width
END SUB
' 2019-06-06 I will build an rgb sub off a mod of this because I can't find the SmallBASIC code or maybe SdlBasic code
FUNCTION rgba~& (n) ' New (even less typing!) New Color System 1000 colors with up to 3 digits
s4$ = RIGHT$("0000" + LTRIM$(STR$(n)), 4)
r = VAL(MID$(s4$, 1, 1)): IF r THEN r = 28 * r + 3
g = VAL(MID$(s4$, 2, 1)): IF g THEN g = 28 * g + 3
b = VAL(MID$(s4$, 3, 1)): IF b THEN b = 28 * b + 3
a = VAL(MID$(s4$, 4, 1)): IF a THEN a = 28 * a + 3
rgba~& = _RGBA32(r, g, b, a) '>>> a is for alpha 0 to 255 0 is completely transparent 255 is completely opaque
END SUB
'from Steve Gold standard
SUB fcirc (CX AS INTEGER, CY AS INTEGER, R AS INTEGER, C AS _UNSIGNED LONG)
DIM Radius AS INTEGER, RadiusError AS INTEGER
DIM X AS INTEGER, Y AS INTEGER
Radius = ABS(R)
RadiusError = -Radius
X = Radius
Y = 0
IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
' Draw the middle span here so we don't draw it twice in the main loop,
' which would be a problem with blending turned on.
LINE (CX - X, CY)-(CX + X, CY), C, BF
WHILE X > Y
RadiusError = RadiusError + Y * 2 + 1
IF RadiusError >= 0 THEN
IF X <> Y + 1 THEN
LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
END IF
X = X - 1
RadiusError = RadiusError - X * 2
END IF
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
WEND
END SUB
'this version needs fcirc and is pretty inefficient but once and a while it comes in handy
SUB thic2 (x1, y1, x2, y2, rThick, K AS _UNSIGNED LONG)
'x1, y1 is one endpoint of line
'x2, y2 is the other endpoint of the line
'rThick is the radius of the tiny circles that will be drawn
' from one end point to the other to create the thick line
'Yes, the line will then extend beyond the endpoints with circular ends.
rThick = INT(rThick / 2): stepx = x2 - x1: stepy = y2 - y1
length = INT((stepx ^ 2 + stepy ^ 2) ^ .5)
IF length THEN
dx = stepx / length: dy = stepy / length
FOR i = 0 TO length
fcirc x1 + dx * i, y1 + dy * i, rThick, K
NEXT
ELSE
fcirc x1, y1, rThick, K
END IF
END SUB
Easylangs Clock window size did adjust to changing window size of browser! I had to scale everything in Easylang to 4 x's pixels for comparison drawings.