Smiley Scroller

Code scrolls smiley faces on screen.
Programmed for QBASIC but tiny modifications, it works fine with FreeBASIC too.

'public domain
'2006 mennonite

COLOR 14, 1
WIDTH , 25: CLS
VIEW PRINT 2 TO 25

q$(1) = "* **** "
q$(2) = " *** * *"
q$(3) = " * *"
q$(4) = "* **** "

FOR b = 1 TO 4
DO WHILE INSTR(q$(b), "*") > 0
MID$(q$(b), INSTR(q$(b), "*"), 1) = CHR$(219)
LOOP
NEXT b

DO
COLOR INT(RND * 6 + 9): x = INT(RND * (80 - 13) + 1)

FOR b = 1 TO 4
PRINT SPACE$(x) + q$(b) ' + SPACE$(80)
t = TIMER + .1: DO: LOOP UNTIL TIMER > t OR TIMER < t - .2
NEXT b
PRINT

LOOP UNTIL INKEY$ = CHR$(27)

VIEW PRINT 1 TO 25
COLOR 7, 0: CLS
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.