| CODE |
| lab 100: cls let l=100 let w=50 let f=10 let p=20 print "Wee Basic - Pong demo" for j=1 to 16 print "" next line 3,f,3,w,1 line l,f,l,w,2 line 3,f,l,f,3 line 3,w,l,w,4 print "Press any key to start" let m=0 while m=0 let m=key() wend let X = p let Y = f+4 let Z = y+1 let d=-1 let k=1 let a=l-1 let b= f+5 let s=1 plot X,Y,1 plot X, Z,1 plot a,b,1 lab begin: let T= key() IF T = 206 AND Y < > f+1 PLOT X,Y,0 PLOT X,Z,0 let Y = Y - 1 let Z = Z -1 PLOT X,Y,1 PLOT X,Z,1 let T = key() endif IF T = 207 AND Z < > w-1 PLOT X,Y,0 PLOT X,Z,0 let Y = Y + 1 let Z = Z + 1 PLOT X,Y,1 PLOT X,Z,1 endif IF a = l-1 let d=-1 endif IF b >= w-1 let s=-1 endif if b<=f+1 let s=1 endif PLOT a,b,0 let a = a + d let b = b + s PLOT a,b,1 if a=2 goto lose: endif IF X + 1 = a AND (Y = b or z=b) let k=1 PLOT a, b,0 let d = 1 let a = a + d let b = b + s PLOT a,b,1 endif goto begin: lab lose: lab lose: print "" PRINT "You Lose" PRINT "Press A to Play Again...." print "or any other key to exit" let m=0 while m=0 let m=key() wend IF m=202 cls PLOT a,b,0 PLOT X,Y,0 PLOT X,Z,0 goto 100: endif END |