Draw a clock: Difference between revisions

Content added Content deleted
Line 1,909: Line 1,909:
[https://easylang.online/apps/clock.html Run it]
[https://easylang.online/apps/clock.html Run it]


<syntaxhighlight lang="text"># Clock
<syntaxhighlight lang="text">
#
func draw hour min sec . .
func draw hour min sec . .
# dial
# dial
Line 1,919: Line 1,918:
circle 44
circle 44
color 333
color 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 a * 40 50 - cos a * 40
circle 0.25
circle 0.25
.
.
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 a * 40 50 - cos a * 40
Line 1,951: Line 1,950:
t = floor systime
t = floor systime
h$ = timestr t
h$ = timestr t
sec = number substr h$ 17 2
sec = number substr h$ 18 2
min = number substr h$ 14 2
min = number substr h$ 15 2
hour = number substr h$ 11 2
hour = number substr h$ 12 2
if hour > 12
if hour > 12
hour -= 12
hour -= 12
Line 1,961: Line 1,960:
timer 0.1
timer 0.1
.
.
timer 0</syntaxhighlight>
timer 0
</syntaxhighlight>


=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==