Spinning rod animation/Text: Difference between revisions

Added Algol 68
m (→‎GUI version: added libheaders and online link)
(Added Algol 68)
Line 109:
Put (ASCII.ESC & "[?25h"); -- Restore the cursor
end Spinning_Rod;</lang>
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68G|Any - tested with release 2.8.3.win32}}
Sadly, Algol 68 doesn't have a standard delay/sleep routine, so this sample delays with a busy loop. A loop of 2 000 000 gives a reasonable spinning rod on the machine I tried it on. Increase the outer loop maximum for a longer animation.
<lang algol68>FOR i TO 1 000 DO # increase/decrease the TO value for a longer/shorter animation #
FOR d TO 2 000 000 DO SKIP OD; # adjust to change the spin rate #
print( ( CASE 1 + i MOD 4 IN "/", "-", "\", "|" ESAC, REPR 8 ) )
OD</lang>
 
=={{header|AWK}}==
3,026

edits