Anonymous user
Spinning rod animation/Text: Difference between revisions
Added solution for Action!
(Added solution for Action!) |
|||
Line 48:
print(rod, end' "\r")
sleep(0.25)</lang>
=={{header|Action!}}==
<lang Action!>PROC Wait(BYTE frames)
BYTE RTCLOK=$14
frames==+RTCLOK
WHILE frames#RTCLOK DO OD
RETURN
PROC Main()
CHAR ARRAY spin="|/-\"
BYTE i,
CH=$02FC, ;Internal hardware value for last key pressed
CRSINH=$02F0 ;Controls visibility of cursor
Print("Press any key to exit...")
CRSINH=1 ;hide cursor
i=1
WHILE CH=$FF
DO
Put(spin(i))
Put(30) ;move cursor left
i==+1
IF i>spin(0) THEN
i=1
FI
Wait(5)
OD
CH=$FF
CRSINH=0 ;show cursor
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Spinning_rod_animation_text.png Screenshot from Atari 8-bit computer]
<pre>
Press any key to exit.../
</pre>
=={{header|Ada}}==
|