home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib16.dsk
/
MUNCHIES.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
5KB
|
145 lines
10 REM **********************
11 REM * MUNCHIES *
12 REM * BY PAUL RAYMER *
13 REM * COPYRIGHT (C) 1983 *
14 REM * BY MICROSPARC, INC *
15 REM * LINCOLN, MA. 01773 *
16 REM **********************
100 TEXT : HOME : CLEAR : REM 3K
220 REM
230 REM INITIALIZE
240 REM
250 M$ = "MUNCHIE "
260 Q$ = CHR$(7)
270 S$ = CHR$(32): VTAB 22: PRINT "** COPYRIGHT 1983 BY MICROSPARC, INC **": VTAB 1
280 FOR X = 1 TO 4:B$ = B$ + CHR$(8): NEXT X
290 PRINT "NEED INSTRUCTIONS (Y/N) ";B$;: GET AN$
300 IF AN$ = "Y" THEN GOSUB 1450
310 FOR X = 1 TO 38:D$ = D$ + CHR$(45): NEXT X
320 H = 1
330 HOME
340 REM
350 REM SET UP TRACK
360 REM
370 VTAB 12: HTAB 16: INVERSE : PRINT "MUNCHIES ";H: NORMAL
380 FOR Y = 1 TO 8
390 VTAB Y: HTAB 1: PRINT D$
400 R = INT(8 * RND(1)) +1
410 VTAB Y: HTAB 1: PRINT Y;
420 VTAB Y: HTAB 39: PRINT R
430 NEXT Y
440 VTAB 10: HTAB 5: PRINT "== PRESS (9) FOR TARGET SCORE == "
450 REM
460 REM RANDOMIZE POINTS
470 REM
480 FOR B = 1 TO 8
490 FOR RR = 1 TO 8
500 R = INT(8 * RND(1)) +1
510 REM
520 REM ZERO CATCHER
530 REM
540 IF PEEK(934 +(RR *128)) = 176 THEN 570
550 GOSUB 1370
560 VTAB RR: HTAB 39: PRINT R
570 NEXT RR
580 REM
590 REM SELECTOR
600 REM
610 FOR X = 10 TO 22: VTAB X -1: HTAB 39: PRINT S$;: VTAB X: HTAB 39: PRINT "C";: FOR Z = 1 TO 20: NEXT Z: NEXT X
620 IF K < >0 THEN M$ = "C "
630 SPEED= 176: FOR I = 38 TO 1 STEP -1: VTAB 22: HTAB 1: PRINT M$: NEXT I:K = 1
640 VTAB 22: HTAB 1: PRINT "WHICH LINE? ";: GET A$:A = VAL(A$): SPEED= 255
650 IF A = 0 THEN 940
660 IF A = 9 THEN 990
670 INVERSE : VTAB A: HTAB 1: PRINT A;: NORMAL
680 FOR X = 2 TO 36
690 VTAB A: HTAB X: PRINT S$;L$;: FOR Z = 1 TO 50: NEXT Z
700 REM
710 REM MUNCHIE MAKER
720 REM
730 IF INT(X/2) = X/2 THEN L$ = " =": GOTO 750
740 L$ = " C"
750 GOSUB 1130
760 NEXT X
770 POKE -16368,0
780 P = PEEK(934 +(A *128)):PP = P -176
790 IF PP = 0 THEN 1180
800 TT = TT +PP
810 IF TT >8 THEN 1220
820 POKE (934 +(128 *A)),176
830 POKE (933 +(128 *A)),190: PRINT Q$;
840 REM
850 REM SCOREBOARD
860 REM
870 PRINT
880 VTAB 19: PRINT TAB( 1)"LAST RUN ";PP; TAB( 15)"TOTAL ";: INVERSE : PRINT TT;: NORMAL : PRINT TAB( 25)"NEXT TURN NO.";B +1
890 A = 0
900 NEXT B
910 REM
920 REM SUDDEN QUIT
930 REM
940 VTAB 19: HTAB 1: CALL -958: PRINT "GAME STOPPED WITH TOTAL OF ";TT
950 GOTO 1260
960 REM
970 REM WRAP UP
980 REM
990 VTAB 22: HTAB 1: PRINT "SELECT TARGET ";: INVERSE : PRINT " TOTAL ";: NORMAL : PRINT S$;: GET J$:J = VAL(J$)
1000 VTAB 22: HTAB 1: PRINT "SELECT ";: INVERSE : PRINT " LINE ";: NORMAL : PRINT " NUMBER ";: GET JJ$:J = VAL(JJ$)
1010 VE = PEEK(934 +(128 *J))
1020 GT = TT *B *10
1030 REM
1040 REM CONFIRM WINNER
1050 REM
1060 IF TT = VE -176 THEN VTAB 19: CALL -958: HTAB 1: INVERSE : PRINT " WINNER WITH ";GT;" POINTS ": NORMAL : GOTO 1260
1070 REM
1080 REM LOSER
1090 REM
1100 GT = 0: VTAB 19: HTAB 1: CALL -958: PRINT "SORRY...TRY AGAIN!"
1110 GOTO 1260
1120 REM
1130 REM MUNCHIE NOISE
1140 REM
1150 N = PEEK( -16336)
1160 RETURN
1170 REM
1180 REM CHEATER CATCH
1190 REM
1200 POKE (935 +(128 *A)),42: VTAB 19: HTAB 1: CALL -958: PRINT "YOU PICKED A ";: INVERSE : PRINT " ZERO! ";: NORMAL : PRINT " GAME OVER!";Q$;Q$;Q$: GOTO 1260
1210 REM
1220 REM OVERSHOOT TRAP
1230 REM
1240 IF TT >8 THEN VTAB 22: HTAB 1: PRINT Q$;Q$;Q$;"YOU ";: FLASH : PRINT " CAN'T ";: NORMAL : PRINT " WIN WITH A SCORE OF ";TT;"!": GOTO 1260
1250 REM
1260 REM PLAY AGAIN
1270 REM
1280 IF HS <GT THEN HS = GT
1290 PRINT "HIGH SCORE THIS SERIES ";HS
1300 VTAB 23: PRINT "ANOTHER GAME OF MUNCHIES? (Y/N)";B$;: GET AN$
1310 H = H +1
1320 IF AN$ < >"N" THEN TT = 0: GOTO 330
1330 PRINT : FOR X = 1 TO 1000: PRINT "*";: NEXT X
1340 FOR X = 1 TO 20: VTAB 20: HTAB 18 +X: PRINT " ";: HTAB 19 +X: PRINT "C";: FOR Z = 1 TO 25: NEXT Z: NEXT X
1350 FOR Z = 1 TO 1000: NEXT Z: HOME
1360 END
1370 REM
1380 REM MUNCHIE FOOD
1390 REM
1400 VTAB RR: HTAB 2: PRINT D$;
1410 PRINT
1420 FOR F = 1 TO (4 *R) STEP 4
1430 VTAB RR: HTAB F +4: PRINT "*";: GOSUB 1130: NEXT F
1440 RETURN
1450 REM
1460 REM INSTRUCTIONS
1470 REM
1480 HOME : SPEED= 200
1490 VTAB 2: HTAB 16: INVERSE : PRINT " MUNCHIES ": NORMAL
1500 FOR Z = 1 TO 1000: NEXT Z
1510 VTAB 4: HTAB 1: PRINT "MUNCHIES IS A GAME THAT WILL TAKE A LIFETIME TO LEARN AND A FEW MINUTES TO PLAY!": PRINT
1520 PRINT "FOLLOW SCREEN INSTRUCTIONS. SELECT A NUMBER FOR POINTS (IN THE RIGHT COLUMN)."
1530 PRINT "THE OBJECT IS TO CONTINUE TO SELECT NUMBERS WHICH WILL EQUAL THE TOTAL OF THE HIGHEST POSSIBLE NUMBER ON THE"
1540 PRINT "RIGHT. WHEN YOU GO AS HIGH AS YOU DARE -- PRESS #9..."
1550 PRINT : PRINT "THIS WILL GIVE YOU INSTRUCTIONS TO GET TOTAL. IF YOU HAVE A VALID SCORE, YOUR COMPUTER WILL GIVE YOU THE TOTAL."
1560 PRINT : PRINT "A RECORD OF HIGH SCORE IS KEPT TO SEE IF YOU CAN BETTER ANY PREVIOUS SCORES."
1570 VTAB 24: HTAB 1: PRINT "=== TO CONTINUE PRESS ANY LETTER === ";: GET AN$
1580 SPEED= 255: RETURN