pong
Home |
Maths |
Stupidity |
Within Computers |
You are at: Pong |
Downloads |

Pong for graphics calculator

(Note: this version is written for the CASIO fx-9750G calculator, although it should work on later CASIO models too.)
(Second note: if you think this should belong in the 'stupidity' section, you are an Unkind Person. Go and and feel guilty for an unspecified length of time.)

Installation instructions

Read your manual as to how to set up programs first. You'll need to type in three programs to run Pong; the main program and two sub-programs which Pong calls for certain functions. Type the programs in exactly as shown, using the given names (to enter a return in the program, press EXE). Then select the 'Pong' program and press F1(EXE) to run it. The controls (hold the keys down, don't just tap them) are:

  • LEFT - move left
  • RIGHT - move right
  • cos - 'turbo' left (uses up one nitro-credit, number remaining shown top left)
  • tan - 'turbo' right (uses up one nitro-credit)
  • 4 - Pause (because its alphabet character is 'P')
  • 1 - Unpause (ditto 'U')
  • 0 - Quit
Nitro-credits allow turbo controls to be used. They are gradually replenished as you continue the game. Use them wisely - sometimes the ball speeds up and you can only keep up by using turbo controls. A good average score is around 150.

Important note: If you don't want to lose your high-scores, don't store anything in the alpha variable 'H' when using your calculator normally, as this is where high-scores are kept.

The programs

Note on speed
The graphics calculator is not a games console; don't expect Pong to ever go much faster than a dying tortoise (or maybe a racing slug, if you're lucky). However, I've had a few requests for ways to speed it up, so I've now colour-coded sections of code which should be optional (though this hasn't been tested), according to which extraneous feature they provide. If all else fails, go and get yourself a Gameboy, or better still, a life.
Colours
  • Red - Nitro (removing this will make the game significantly harder, unless you also remove random bouncing)
  • Green - Bat-shrinking (i.e. the bat shrinks as your score increases - removing this will make the game a little easier)
  • Ochre - Random bouncing (i.e. the ball will occasionally change speed on bounce - removing this will make the game incredibly boring, but if you want to fiddle you can try and just simplify it)
  • Blue - Pause and unpause (this also makes one of the sub-programs unnecessary)
If you choose to omit sections, however, be very careful to not leave in any left-over ':' signs as this will probably break the game. As I couldn't be bothered to make 5 sets of images of different colours, however, the calculator signs represented by images (->, for example) will stay black.

PONG

ClrText:0->E:8->P:1->X:1->Y:1->A:1->B:0->S:30->G:0.2->I:4->L
Ran#×20->R:Int R->R:R+1->R
R->X
Ran#->R:R<0.5=>-1->A:R>=0.5=>1->A
Do
ClrText
Locate 1,1,Int G
S<50=>Locate P,7,"[====]" [Note: here the => is missed out if you are missing out the other green bits.]
S>=50 And S<100=>Locate P,7,"[===]"
S>=100 And S<200=>Locate P,7,"[==]"
S>=200=>Locate P,7,"[=]"
Locate Int X,Y,"O"
Getkey->K
K=38=>P-1->P
K=27=>P+1->P
K=36 And Int G>0=>P-2->P
K=36 And Int G>0=>G-1->G
K=26 And Int G>0=>P+2->P
K=26 And Int G>0=>G-1->G
K=73=>Prog "WAIT"
P<1=>1->P
S<50 And P>16=>16->P [Note: once again the => counts as part of the green section.]
S<100 And P>17=>17->P
S<200 And P>18=>18->P
S>=200 And P>19=>19->P
X+A->X
Y+B->Y
X>21=>-A->A
X>21=>(21+A)->X
X<1=>-A->A
X<1=>(1+A)->X
Y<2=>1->B
Y=6 And Int X=P=>-1->B
Y=6 And Int X=P+1=>-1->B
Y=6 And Int X=P+2=>-1->B
Y=6 And Int X=P+3 And S<200=>-1->B
Y=6 And Int X=P+4 And S<100=>-1->B
Y=6 And Int X=P+5 And S<50=>-1->B [Note: if you are omitting this section it must be replaced with:
Y=6 And (Int X>=P And Int X<=P+5) ]
Y=6 And B=-1=>G+I->G
Y=6=>Ran#->R
Y=6 And B=-1 And R<=1=>A->A
Y=6 And B=-1 And R<=0.4=>2->A
Y=6 And B=-1 And R<=0.32=>1->A
Y=6 And B=-1 And R<=0.24=>-A->A
Y=6 And B=-1 And R<=0.16=>-2->A
Y=6 And B=-1 And R<=0.08=>-1->A
Y=7=>71->K
S+1->S
LpWhile K!=71
ClrText
Locate 1,1,Int G
S<50=>Locate P,7,"[====]" [Note: Here the => is part of the green, again.]
S>=50 And S<100=>Locate P,7,"[===]"
S>=100 And S<200=>Locate P,7,"[==]"
S>=200=>Locate P,7,"[=]"
Locate Int X,Y,"O"
Prog "PAUSE2"
Locate 6,3,"GAME OVER"
S>H=>Locate 3,4,"NEW HIGH SCORE!"
S>H=>5->L
S>H=>S->H
S<1000=>Locate 6,L,"SCORE-"
S>=1000=>Locate 5,L,"SCORE-"
S<10=>Locate 14,L,S
S>=10 And S<100=>Locate 13,L,S
S>=100 And S<1000=>Locate 12,L,S
S>=1000=>Locate 12,L,S

WAIT

Do
Getkey->T
T=71=>71->K
T=71=>72->T
LpWhile T!=72
Return

PAUSE2

For 1->T To 300:T->T:Next
Return

Notes

Tweaking settings
If you have a look at the first line of the 'PONG' program, you'll see that most of it is a sequence of statements of the form
val->name
These are the settings for Pong which affect various elements of the game. You can alter them by changing val. Here's what some of the variables mean:
  • S - your initial score
  • G - the number of nitro-credits you start with
  • I - how many nitro-credits are added per bounce (eg. 0.2=5 bounces to add 1 nitro-credit)
I leave the rest to you to find out (i.e. I've forgotten what they do).
How to find all the programming commands and keys
Here's a list of all the commands and symbols used here and what menus they're accessible from (you may have to scroll along the menu to find them). Note that commands can't just be typed in using the ALPHA key, they have to be selected from the various menus.
Symbols
    => : PRGM-JUMP-=>
  • >= : PRGM-REL->=
  • <= : PRGM-REL-<=
  • = : SHIFT-.
  • != : PRGM-REL-!=
  • < : PRGM-REL-<
  • > : PRGM-REL->
  • : [i.e. the colon symbol] : PRGM-:
  • ClrText : PRGM-CLR-Text
  • Ran# : OPTN-PROB-Ran#
  • Do : PRGM-COM-Do (it's on the third set of buttons - don't give up)
  • Locate : PRGM-I/O-Lcte
  • Int : OPTN-NUM-Int
  • " : ALPHA (pressing ALPHA or SHIFT-ALPHA brings up a set of punctuation symbols)
  • And : OPTN-LOGIC-AND (once again, it's on the third set of buttons)
  • GetKey : PRGM-I/O-Gtky
  • Prog : PRGM-CTL-Prog
  • LpWhile : PRGM-COM-Lp·W (third set of buttons)
  • Return : PRGM-CTL-Rtrn
  • For : PRGM-COM-For
  • To : PRGM-COM-To
  • Next : PRGM-COM-Next



This version of Pong designed and implemented by Mark Hutchinson. It is not affiliated in any way to the original.
© Mark Hutchinson 2003
Contact details
Site designed using !HTML³ and !Weave