Animation: Difference between revisions
m
→{{header|smart BASIC}}: fix markup
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
Thundergnat (talk | contribs) m (→{{header|smart BASIC}}: fix markup) |
||
Line 4,457:
=={{header|smart BASIC}}==
<syntaxhighlight lang="
word$="Hello World! "
'use button window with text
Line 4,473:
word$=RIGHT$(word$,LEN(word$)-1)&LEFT$(word$,1)
ENDIF
UNTIL 0</
This program can be concatenated onto a single line using ! as the concatenator:
<
SET BUTTONS CUSTOM!SET BUTTONS FONT SIZE 40!DRAW COLOR 0,0,0!DO!'the button is redrawn each loop!BUTTON "anim" TEXT word$ AT 130,100!PAUSE .1!'touching the button reverses the scrolling!IF BUTTON_PRESSED("anim") THEN flag=1-flag!IF flag THEN!'shift right!word$=RIGHT$(word$,1)&LEFT$(word$,LEN(word$)-1)!ELSE!'shift left!word$=RIGHT$(word$,LEN(word$)-1)&LEFT$(word$,1)!ENDIF!UNTIL 0</
Mr. Kibernetik, the creator of smart Basic, offered this ultra-compact one-line version:
<
and smart Basic Forum member sarossell found a way to shorten even that! See if you can spot what is changed.
<
=={{header|Standard ML}}==
|