1 rem rosetta code
2 rem task: animation
3 rem based on "Commodore BASIC" code at https://rosettacode.org/wiki/Animation#Commodore_BASIC
10 t$="hello world! ":d=-1
20 screen 7 : cls : print : print "press space bar to change direction" : print
30 print "*****************"
35 print "* *"
40 print "* *"
45 print "* *"
50 print "*****************"
55 color 14, 0
60 locate 6,3 : print t$
70 k$ = inkey$
75 if k$=" " then d=not d
80 on (abs(d))+1 gosub 1000,1010
90 if k$="q" then print chr$(147):end
95 rem
100 rem between line 80 and line 999
110 rem check for other user input
120 rem and process accordingly
130 rem
999 _delay 0.25:goto 60
1000 t$=right$(t$,len(t$)-1)+left$(t$,1):return
1010 t$=right$(t$,1)+left$(t$,len(t$)-1):return