Pong

(my edition) -- 2006-02-23
340 calculator bytes

Use the left and right arrow keys to control the game.

Ooops! This code had a bug. See below for the right code, the changed line is in bold text. Thanks to you who mailed me so i could find it.
/Olle 2006-09-18


Note: Before playing the first time, set the highscore value (Mat A[1,1]) to zero.
-> means right arrow.
=> means the right arrow in the "jump" menu.

0->P
1->B
1->C~D
Int 17Ran# +1->A
A->E
Lbl 1
ClrText
Locate 10,1,P           Delete this line if you want a faster game.
Locate A,B,"O"
K=0=>Getkey->K
Locate E,7,"#####"
K=38=>Dsz E
K=27=>Isz E
E=18=>1->E
E=0=>17->E
Getkey->K
A=21=>-1->C
A=1=>1->C
B=1=>1->D
If B=7
Then -1->D
Locate 10,1,P             ...and insert this instead.
A-E<0 Or A-E>4=>Goto 9
Isz P
Ifend
K=0=>Getkey->K
A+C->A
B+D->B                 <-------THIS LINE HAD A BUG AND IS CHANGED!
Goto 1
Lbl 9
Locate 10,1,P                 ...and insert this also.
Locate 6,3,"GAME OVER!"
Mat A[1,1]->H
P>H=>P->Mat A[1,1]
Locate 6,4,"HISCORE:"
Locate 14,4,H
P>H=>Locate 6,3,"HISCORE! "
Locate 7,6,"~PONG~"


To home page

To the top