High
Score Saver
by Tuong Tran
by Tuong Tran
The program below is a very useful one for anyone who makes games in BASIC. This program can be stuck at the front and end of any of your BASIC programs in order to save the top ten high scores of the day. First you enter your score. Then with your joystick you enter your name. If you want, you could even have your BASIC game program enter the score and all you need to do is enter your name. Again this program uses ATARI's special character set that doesn't show up on our printers, so before you type in the program make sure you check the page titled 'Listing Conventions'. Until next issue, Have Fun!
1 DIM S$(1),C$(300),B$(15),SCORE(15):SCREEN=PEEK(88)+PEEK(89):POKE 751,1
2 POKE 710,96:FOR W=15 TO 109:C$(W,W+1)="-":NEXT W
3 POKE 752,0:? "(ESC CTRL CLEAR) INPUT YOUR SCORE PLEASE";:INPUT SCORE:POKE 752,1:GOSUB 8000
4 GOTO 3
5 REM
8000 GOSUB 8050:IF SCORE(10)<SCORE THEN SCORE(10)=SCORE:GOTO 8100
8010 RETURN
8020 REM
8030 REM -SORTING-SUBROTINE ----------
8040 REM
8050 FOR W=1 TO 9:MAX=SCORE(W):H=W:FOR E=W+1 TO 10:IF MAX<SCORE(E) THEN MAX=SC0RE(E):H=E
8060 NEXT E
8070 T=SCORE(W):B$=C$(15*W,15*W+14):SC0RE(W)=SC0RE(H):C$(15*W,15*W+15)=C$(H*15,15*H+14):SCORE(H)=T
8080 C$(15*H,15*H+14)=B$:NEXT W:RETURN
8090 REM --OUTPUT-THE-ENTRY-TABLE----
8100 ? "↓↓↓↓ ENTER -NAME↓↓"
8110 ? "(CTRL Q)(((CTRL R*3)(CTRL W))*5)(CTRL R*3)(CTRL E)"
8120 ? " |A|B|C|D|E|F|"
8130 ? "(CTRL A)(((CTRL R*3)(CTRL S))#5)(CTRL R*3)(CTRL D)"
8140 ? " |G|H|I|J|K|L|"
8150 ? "(CTRL A)(((CTRL R*3)(CTRL S))*5)(CTRL R*3)(CTRL D)"
8160 ? " |M|N|O|P|Q|R|"
8170 ? "(CTRL A)(((CTRL R*3)(CTRL S))*5)(CTRL R*3)(CTRL D)"
8180 ? " |S|T|U|V|W|X|"
8190 ? "(CTRL A)(((CTRL R*3)(CTRL S))*5)(CTRL R*3)(CTRL D)"
8200 ? " |Y|Z|,|-| | |DEL|"
8210 ? "(CTRL A)(((CTRL R*3)(CTRL S))*3)(((CTRL R*3)(CTRL X))*2(CTRL R*3)(CTRL C)"
8220 ? " |END|LIS|GAM|"
8230 ? " (CTRL Z)(((CTRL R*3)(CTRL X))*2)(CTRL R*3)(CTRL C)"
8240 POKE 85,20:? ;"↓(CTRL Q)(CTRL R*11)(CTRL E)"
8250 POKE 85,20:? ;"| |"
8260 POKE 85,20:? ;"(CTRL Z)(R*I1)(CTRL C)"
8270 PL=SCREEN+20+40*21:B$="(SP*15)"
8280 X=10:Y=7:A=SCREEN+X+40*:B=FEEK(A):POKE A,B+128
8290 S=STICK(0)
8300 IF S<>7 AND S<>11 THEN 8390
8310 IF S=7 THEEN X=X+4
8320 IF S=11 THEN X=X-4
8330 IF X=6 THEN X=30:Y=Y-2
8340 IF X=34 THEN X=10:Y=Y+2
8350 IF Y>15 AND X=22 THEN X=10:Y=7
8360 IF Y<7 THEN X=18:Y=17
8370 POKE A,B:A=SCREEN+X+40*Y:B=PEEK(A):POKEA,B+128
8380 FOR W=1 TO 50:NEXT W:GOTO 8290
8390 IF STRIG(0)=0 THEN C=C+1:GOTO 8410
8400 GOTO 8290
8410 IF X=14 AND Y=17 THEN C$(150,185)=B$:GOSUB 8050:GOTO 8510
8420 IF X=18 AND Y=17 THEN C$(150)=B$:GOSUB 8050:GOTO 8610
8430 IF X=30 AND Y=15 THEN 8480
8440 IF C=12 THEN C=C-1:GOTO 8470
8450 IF X=10 AND Y=17 THEN FOR W=C TO 11:POKE PL+W,128:B$(W)=(SP*1):NEXT W:C=11:GOTO 8470
8460 B$(C)=CHR$(B+160):POKE PL+C,B+128:GOTO 8380
8470 FOR W=1 TO 30:NEXT W:GOTO 8290
8480 IF C<=1 THEN C=0:GOTO 8380
8490 C=C-1:POKE PL+C,0:C=C-1:GOTO 8470
8500 REM -OUTPUT-THE-TOP-TEN-SCORES--
8510 ? "|||| (CTRL Q)(CTRL R*29)(CTRL E)"
8520 ? " |TOP TEN SCORES|"
8530 ? "(CTRL A)(CTRL R*16)(CTRL W)(CTRL R*12)(CTRL D)"
8540 ? " | NAME | SCORE |"
8550 ? "(CTRL A)(CTRL R*16)(CTRL S)(CTRL R*12)(CTRL D)"
8560 FOR W=1 TO 10:? " | ||":NEXT W
8570 ? "(CTRL Z)(CTRL R*16)(CTRL X)(CTRL R*12)(CTRL C)"
8580 ? "↓↓ PRESS TRIGGER TO PLAY AGAIN"
8590 ? "(↑*15)"
8600 FOR W=1 TO 10:POKE 85,6:? W-1;" ";:? C$(15*W,15*W+10);:POKE 85,24:? ;SCORE(W):NEXT W
8610 FOR W=15 TO 185:S$=C$(W,W+1):IF ASC(S$)>=ASC("(SP*1)") THEN C$(W,W+1)=CHR$(ASC(S$)-(ASC("")-ASC("A")))
8620 NEXT W
8630 IF STRIG(0)<>0 THEN 8630
8640 C=0:RETURN