Metronome: Difference between revisions
Added XPL0 example.
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(Added XPL0 example.) |
||
Line 2,256:
TICK tick tick tick
</pre>
=={{header|XPL0}}==
<syntaxhighlight lang "XPL0">int BPM, Odd, Time0, Delay;
[Text(0, "Beats per minute: ");
BPM:= IntIn(0);
Odd:= true;
Delay:= 60_000_000/BPM; \microseconds per beat
repeat Time0:= GetTime;
repeat until GetTime-Time0 >= Delay;
Text(0, if Odd then "tick" else " TOCK^m^j");
Odd:= not Odd;
until KeyHit;
]</syntaxhighlight>
{{out}}
<pre>
Beats per minute: 120
tick TOCK
tick TOCK
tick TOCK
tick TOCK
tick</pre>
{{omit from|GUISS}}
|