ZX81 Listing for ball.p


ZX81 program listing for **THE BALL**SLR/1983**

**THE BALL**SLR/1983** (ball.p)

A bouncing ball animation.


SYSTEM VARIABLES

PROG  : 16509
D-FILE: 18066
VARS  : 18859
E-LINE: 18860
STKBOT: 18860
STKEND: 18860


LEGEND

9999 means line number
PRINT means treat as KEYWORD P


PROGRAM LISTING

   1 REM BY:STEVEN L. REID <SLR>
          (DESIGNED)1983        
        <<<<THE BALL>>>>
   2 SLOW
   5 LET B=0
  10 PRINT "THE BALL<BY:STEVEN R
EID(C)1983>"
  11 PRINT "                    
            "
  12 FOR A=2 TO 20
  13 PRINT " ";TAB 31;" "
  14 NEXT A
  15 PRINT "                    
            "
  20 FOR A=2 TO 20
  30 PRINT AT A,10;"    !!!!¸¸¸¸
!!¸¸  "
  40 NEXT A
  50 LET H=-1
  60 LET V=1
  70 LET X=20
  80 LET Y=1
  90 LET C=X
 100 LET U=Y
 110 LET A$=" "
 120 LET B$=" "
 130 LET J=1
 140 PRINT AT X,Y;A$;AT C,U;B$
AND (X<>C OR Y<>U)
 150 REM **CHECK COLOR**
 151 IF B=1 THEN GOTO 400
 160 IF J=9 THEN LET A$=" "
 161 IF J=10 THEN LET B$=" "
 170 IF J=13 THEN LET A$="¸"
 171 IF J=14 THEN LET B$="!"
 180 IF J=17 THEN LET A$="!"
 181 IF J=18 THEN LET B$="¸"
 190 IF J=21 THEN LET A$="¸"
 191 IF J=22 THEN LET B$="!"
 200 IF J=23 THEN LET A$="!"
 201 IF J=24 THEN LET B$="¸"
 210 IF J=25 THEN LET A$=" "
 211 IF J=26 THEN LET B$=" "
 220 IF J=27 THEN LET A$=" "
 221 IF J=28 THEN LET B$=" "
 230 REM ***MOVEMNT***
 240 LET C=X
 250 LET U=Y
 260 LET X=X+H
 270 LET Y=Y+V
 280 IF X=2 OR X=20 THEN LET H=-
H
 290 IF Y=1 OR Y=30 THEN LET V=-
V
 300 IF J=30 THEN LET B=1
 301 IF B=1 THEN GOTO 340
 310 LET J=J+1
 320 REM ***GOTO START***
 330 GOTO 140
 340 LET J=J-1
 350 IF J=1 THEN LET B=0
 360 GOTO 140
 400 REM **CHECK COLOR**
 410 IF J=28 THEN LET A$=" "
 411 IF J=27 THEN LET B$=" "
 420 IF J=26 THEN LET A$="!"
 421 IF J=25 THEN LET B$="¸"
 430 IF J=24 THEN LET A$="¸"
 431 IF J=23 THEN LET B$="!"
 440 IF J=22 THEN LET A$="!"
 441 IF J=21 THEN LET B$="¸"
 450 IF J=18 THEN LET A$="¸"
 451 IF J=17 THEN LET B$="!"
 460 IF J=14 THEN LET A$=" "
 461 IF J=13 THEN LET B$=" "
 470 IF J=10 THEN LET A$=" "
 471 IF J=9 THEN LET B$=" "
 480 GOTO 230
 490 SAVE "BALL"
 500 RUN