home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
058.SHOWTELL.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
6KB
|
144 lines
100 REM
110 REM Show and Tell Memory Game
120 REM by Randy Hawkins, for ONE THOUSAND Magazine
130 REM
132 COMMON RH: IF RH = 0 THEN SYSTEM
134 CLEAR: KEY (17) ON: KEY 17, CHR$(0) + CHR$(1)
136 ON KEY (17) GOSUB 1500
140 SCREEN 0: WIDTH 40: KEY OFF: COLOR 14,1,1: CLS
150 REM
160 REM Count Number of Q & A Sets (Store in NS)
170 REM
180 ON ERROR GOTO 200: NS = 0
190 READ A$: NS = NS + 1: GOTO 190
200 RESUME 210
210 NS = NS / 19: ON ERROR GOTO 0: DIM Q$(8), A$(8), N(8)
220 RANDOMIZE TIMER: DEF FNR(X) = INT(RND(1) * X) + 1
230 REM
240 REM Present Title Page
250 REM
260 LOCATE 4,13,0: PRINT "Show and Tell"
270 LOCATE 6,8: PRINT "A Game by Randy Hawkins": PRINT
280 PRINT "You will be shown the answers to nine"
290 PRINT "questions for a few seconds. Try to"
300 PRINT "memorize each answer and its position"
310 PRINT "on the screen. As each question is"
320 PRINT "presented, enter the number of the"
330 PRINT "correct answer. Good luck!": PRINT
340 PRINT "Press <any key> to begin the game..."
350 DEF SEG=0: POKE 1050, PEEK(1052): WHILE INKEY$="": WEND
360 REM
370 REM Pick a Q & A Set and Scramble the Order
380 REM
390 CLS: RESTORE: FOR A = 1 TO FNR(NS): READ T$: FOR B = 0 TO 8
400 READ Q$(B), A$(B): NEXT B,A: FOR A = 1 TO 25: B = FNR(9) - 1
410 C = FNR(9) - 1: SWAP Q$(B),Q$(C): SWAP A$(B),A$(C): NEXT A
420 REM
430 REM Present Game Screen and Begin
440 REM
450 PRINT STRING$(40,205): LOCATE 2,1: PRINT "Show and Tell"
460 LOCATE 2,25: PRINT "by Randy Hawkins": LOCATE 3,1: PRINT STRING$(40,205)
470 COLOR 4,0: LOCATE 4,2: PRINT STRING$(38,32);: FOR A = 0 TO 8
480 LOCATE A+5,2: PRINT A+1; "..."; CHR$(32); A$(A);TAB(40): NEXT A
490 LOCATE 14,2: PRINT STRING$(38,32): COLOR 14,1: PRINT STRING$(40,205);
500 REM
510 REM Display Answers (for PAUSE seconds) then Clear
520 REM
530 PAUSE = 5: X = TIMER: WHILE X + PAUSE > TIMER: WEND
540 COLOR 4,0: FOR A = 0 TO 8: LOCATE A+5,8: PRINT STRING$(31,32);
550 NEXT A: COLOR 14,1: LOCATE 20,2: PRINT STRING$(38,205);
560 R = 0: T = 0: LOCATE 24,2: PRINT STRING$(38,205);
570 FOR A = 0 TO 8: N(A) = A: NEXT A: FOR A = 1 TO 25
580 B = FNR(9) - 1: C = FNR(9) - 1: SWAP N(B),N(C): NEXT A: A = 0
590 REM
600 REM Display a Question and Wait for Answer
610 REM
620 A = A + 1 + 9 * (A = 8): IF N(A) < 0 THEN 620
630 COLOR 14,1: LOCATE 17,21 - LEN(T$) / 2: PRINT T$
640 LOCATE 18,21 - (LEN(Q$(N(A)))+1) / 2: PRINT Q$(N(A)); "?"
650 LOCATE 22,4: PRINT "Press the <NUMBER> of your answer";
660 DEF SEG=0: POKE 1050, PEEK(1052): H$ = ""
670 H$ = INKEY$: IF H$ = CHR$(27) THEN 900
680 IF H$ < "1" OR H$ > "9" THEN 670
690 LOCATE 22,1: PRINT STRING$(40,32): B = VAL(H$) - 1
700 LOCATE B+5,2: COLOR 4,0: PRINT B + 1; "..."; CHR$(32);
710 PRINT A$(B);: COLOR 14,1: T = T + 1: IF B = N(A) THEN 840
720 REM
730 REM Answer Did Not Match
740 REM
750 H$ = "Sorry! That's wrong!": FOR C = 1 TO 10: LOCATE 22,21-C
760 PRINT LEFT$(H$,C); RIGHT$(H$,C);: SOUND 500 - C*20, 1
770 SOUND 500 - C*20 - 30, 1: NEXT C: X = TIMER
780 WHILE X + PAUSE > TIMER: WEND: LOCATE B+5,8: COLOR 4,0
790 PRINT STRING$(28,32);: COLOR 14,1: LOCATE 17,1: PRINT STRING$(80,32)
800 LOCATE 22,1: PRINT STRING$(40,32): GOTO 620
810 REM
820 REM Right Answer, Increment Counter R
830 REM
840 H$ = STRING$(15,32) + "You got it!": FOR C = 1 TO 26: LOCATE 22,1
850 PRINT RIGHT$(H$,C): SOUND 100 + C*50, 1: NEXT C: R = R + 1
860 N(A) = -1: X = TIMER: IF R < 9 THEN 780
870 REM
880 REM All Done ... Display Score
890 REM
900 WHILE X + PAUSE > TIMER: WEND: LOCATE 17,1: PRINT STRING$(80,32)
910 LOCATE 22,1: PRINT STRING$(40,32): LOCATE 17,10
920 PRINT R; "questions answered": LOCATE 18,13: PRINT "in only";
930 PRINT T; "tries!": LOCATE 22,11: PRINT "Play again (Y or N)?"
940 H$ = INKEY$: IF H$="Y" OR H$="y" THEN CLS: GOTO 134
950 IF H$ = "N" OR H$ = "n" THEN 1500 ELSE 940
960 REM
970 REM Data Set #1
980 REM
990 DATA "Where do you"
1000 DATA "go to sleep", "in your bed"
1010 DATA "put your TV antenna", "on the roof"
1020 DATA "go to see a ball game", "in the Astrodome"
1030 DATA "keep your car", "in the garage"
1040 DATA "grow vegetables", "in the garden"
1050 DATA "go to meet Dracula", "in Transylvania"
1060 DATA "land an Apollo spaceship", "on the moon"
1070 DATA "hang a picture", "on the wall"
1080 DATA "bake a cake", "in the oven"
1090 REM
1100 REM Data Set #2
1110 REM
1120 DATA "When do you"
1130 DATA "go to sleep", "every night"
1140 DATA "eat a meal", "three times a day"
1150 DATA "pay income tax", "before April 15"
1160 DATA "celebrate Christmas", "December 25"
1170 DATA "go to the beach", "in the summertime"
1180 DATA "answer the phone", "when the phone rings"
1190 DATA "change the oil in your car", "every 6000 miles"
1200 DATA "go to the doctor", "when you are sick"
1210 DATA "have a leap year", "once every four years"
1220 REM
1230 REM Data Set #3
1240 REM
1250 DATA "What do you"
1260 DATA "eat with spaghetti", "meatballs"
1270 DATA "get mixing dirt and water", "mud"
1280 DATA "wear on your head", "straw hat"
1290 DATA "keep in your wallet", "money"
1300 DATA "use to write a letter", "pencil"
1310 DATA "use to play computer games", "Tandy 1000"
1320 DATA "use as fish bait", "worms"
1330 DATA "use to blow your nose", "tissue"
1340 DATA "find on a used car lot", "old cars"
1350 REM
1360 REM Data Set #4
1370 REM
1380 DATA "Who is"
1390 DATA "the president", "George Bush"
1400 DATA "the Tonight Show host", "Johnny Carson"
1410 DATA "Disneyland's Mascot", "Mickey Mouse"
1420 DATA "the world's strongest man", "Superman"
1430 DATA "the meanest man in Dallas", "J. R. Ewing"
1440 DATA "the discoverer of America", "Christopher Columbus"
1450 DATA "the heavyweight boxing champ", "Mike Tyson"
1460 DATA "married to Prince Charles", "Princess Diana"
1470 DATA "the king of Rock of Roll", "Elvis Presley"
1500 SCREEN 0: WIDTH 80: CLS: LOCATE 12,30
1510 PRINT "One Moment Please...": RUN "menu"