-
Notifications
You must be signed in to change notification settings - Fork 1
/
WhatHappenedToTheFrog.txt
95 lines (95 loc) · 3.91 KB
/
WhatHappenedToTheFrog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
5 HOME : REM CLEAR SCREEN
10 REM HOW DO IT KNOW
15 REM DIM VARIABLES
20 DIM V1$(10),N1$(10)
25 REM LOAD DATA INTO VARIABLES
30 FOR A = 1 TO 4
35 READ V1$(A)
40 NEXT A
45 FOR A = 1 TO 5
50 READ N1$(A)
55 NEXT A
100 REM THE STORY STARTS HERE
105 PRINT "YOU'RE STANDING IN A ROOM. IN THE "
110 PRINT "MIDDLE OF THE ROOM ARE THESE ITEMS:"
115 PRINT
120 REM LISTING OUT THE ITEMS
125 FOR A = 1 TO 5
126 REM CHANGE PRIOR 4 TO A 5
130 PRINT N1$(A)
135 NEXT
140 PRINT : PRINT
145 GOTO 200: REM GOING TO THE PARSER
150 REM BACK FROM THE PARSER. CARRYING OUT THE INSTRUCTIONS
155 IF V$ = "EAT" THEN GOTO 505
160 IF V$ = "SMELL" THEN GOTO 545
165 IF V$ = "DRINK" THEN GOTO 565
170 IF V$ = "GIVE" THEN GOTO 580
200 REM HERE'S HOW IT'S DONE
205 V$ = "":N$ = ""
210 PRINT "WHAT DO YOU WANT TO DO? ";
215 INPUT "";A$
220 REM NOW WE'LL BREAK DOWN THE INPUT INTO VERB AND NOUN
225 REM FIRST GET THE VERB
230 FOR A = 1 TO LEN (A$)
235 IF MID$ (A$,A,1) = " " THEN X = A + 1: A = 0: GOTO 260: REM THIS LOOKS FOR THE BLANK SEPARATING THE WORDS
240 V$ = V$ + MID$ (A$,A,1)
245 NEXT A
250 X = A - 1: REM IN CASE THERE'S ONLY ONE WORD. IF X= THE WHOLE LENGTH OF THE STRING, THE NEXT LINE WILL SEND YOU BACK TO THE BEGINNING
255 IF X = LEN (A$) THEN PRINT : PRINT "I CAN'T ";V$;" NOTHING.": PRINT : GOTO 100
260 REM NOW GET THE NOUN
265 IF X = LEN (A$) THEN PRINT : PRINT "I CAN'T ";V$;" NOTHING.": PRINT : GOTO 100
270 N$ = MID$ (A$,X, LEN (A$) - (X - 1))
275 REM CHECK TO SEE IF VERB IS GOOD
280 FOR A = 1 TO 5
285 IF V$ = V1$(A) THEN A = 0: GOTO 305: REM VERB IS O.K.
290 NEXT A
295 PRINT
300 PRINT "I CAN'T ";V$;" SOMETHING.": PRINT: GOTO 100
305 REM CHECK TO SEE IF NOUN IS GOOD
310 FOR A = 1 TO 5
315 IF N$ = N1$(A) THEN A = 0: GOTO 155: REM EVERYTHING CHECKS AND NOW WE'LL DO SOMETHING.
320 NEXT A
325 PRINT : PRINT "SORRY, THERE'S NO ";N$;" HERE.": PRINT : GOTO 100: REM SOMETHING'S WRONG SO WE HAVE TO START OVER
500 REM HERE'S WHERE THINGS HAPPEN
505 REM EATING THINGS
510 IF N$ = N1$(3) THEN CO = 1: PRINT : PRINT "I'M IN LOVE.": PRINT : GOTO 100
515 PRINT : PRINT "I CAN'T EAT A ";N$: PRINT : PRINT "BURP! I GUESS I CAN.": PRINT
520 FOR A = 1 TO 4
525 IF N$ = N1$(A) THEN N1$(A) = "":A = 0: GOTO 535
530 NEXT A
535 X = 0: FOR A = 1 TO 4:X = LEN (N1$(A)) + X: NEXT : IF X = 0 THEN GOTO 900: REM CHECKING TO SEE IF EVERYTHING EATEN
540 GOTO 100
545 REM SMELLING THINGS
550 IF N$ = N1$(1) THEN N$ = N1$(5)
555 IF N$ = N1$(3) THEN N$ = "SKUNK CABBAGE"
560 PRINT : PRINT "THAT SMELLS LIKE A ";N$;"" : PRINT : GOTO 100
561 REM 2023 ADDED SPACE AFTER A
565 REM DRINKING
570 IF N$ = N1$(4) THEN PRINT : PRINT "THAT WAS THE LAST BOTTLE OF SACRED ALE.": GOTO 900
575 PRINT : PRINT "YOU CAN'T.": PRINT : GOTO 100
580 REM GIVING THINGS AWAY
585 IF N$ = N1$(5) THEN PRINT : PRINT "WHAT? ";: GOTO 595
586 REM CHANGE N1$(1) TO N1$(5) TO CHANGE GIVING TO PRINCESS INSTEAD OF GOAT
590 PRINT "YOU CAN'T GIVE A ";N$; " ANYTHING." : PRINT : GOTO 100
595 INPUT "";N$ : IF LEN (N1$(2)) > 0 AND N$ = N1$(2) AND CO > 0 THEN GOTO 800
600 PRINT : GOTO 100
800 REM AND HERE'S THE WINNING OUTCOME OF THE GAME
805 PRINT : PRINT "THERE IS A CLAP OF THUNDER AND THE "
810 PRINT "HIGH PRIEST OF YORE APPEARS, MARRIES"
815 PRINT "YOU AND THE PRINCESS, GIVES YOU HALF"
820 PRINT "A KINGDOM AND LEAVES. YOU HAVE WON."
825 PRINT "UNFORTUNATELY, THE PRINCESS HAS JUST"
830 PRINT "TURNED BACK INTO A GOAT."
835 END
900 REM AND HERE'S THE LOSING OUTCOME
905 PRINT : PRINT "OH OH. YOU HAVE OFFENDED MARVIN, CHIEF"
910 PRINT "GOD OF ADVENTURE PLAYERS AND BARBERS."
915 PRINT "HOWEVER, HE MAY GIVE YOU JUST ONE OR"
920 PRINT "MORE CHANCES TO PLAY AGAIN."
925 PRINT
930 PRINT "DO YOU WANT TO? ";: INPUT "";A$: IF LEFT$(A$,1) = "Y" THEN RESTORE : GOTO 30
935 END
950 DATA "EAT","DRINK","SMELL","GIVE"
955 DATA "GOAT","FLOWER","CABBAGE","BOTTLE","PRINCESS"
956 REM 2023 PRIOR LINE HAS CABBAGE ADDED TO NOUN LIST