-
Notifications
You must be signed in to change notification settings - Fork 0
/
MADLIBS.hpb
320 lines (320 loc) · 10.6 KB
/
MADLIBS.hpb
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
10 REM *** MADLIBS *** WRITTEN BY DAVE KAUFMAN, AUGUST '74
20 REM *** COPYRIGHT, PEOPLE'S COMPUTER CO. ***
20 REM *** 1919 MENALTO AVE, MENLO PARK, CA. 94025 ***
40 REM
100 REM * DELCARE STRING VARIABLES
110 REM * A$ TO O$ ARE USED BY THE STORIES FOR PLAYER INPUT
112 REM * X$ AND Y$ ARE USED BY THE MAIN PROGRAM
120 DIM A$(30),B$(30),C$(30),D$(30),E$(30),F$(30),G$(30),H$(30),I$(30)
130 DIM J$(30),K$(30),L$(30),M$(30),N$(30),O$(30)
140 DIM X$(72),Y$(72)
150 REM * Q HOLDS A QUEUE OF STORIES, WAITING TO BE USED.
152 REM Q(1,1) Q(1,2)
154 REM Q(2,1) Q(2,2)
156 REM Q(3,1) Q(O3,2)
158 REM Q(4,1) Q(4,2)
160 REM
162 REM * THE FIRST COLUMN HOLDS THE STORY #S IN THE 'READY' QUEUE
164 REM * (THE NEXT RANDOM STORY GETS CHOSEN FROM THIS QUEUE)
166 REM * AND THE SECOND COLUMN HOLDS THE 'WAIT QUEUE'
168 REM * (WHEN A STORY IS CHOSEN FROM THE 'READY' QUEUE', IT GETS
170 REM * PUT INTO THE 'WAIT' QUEUE NEXT, AND WAITS ITS TURN. THE
172 REM * 'WAIT' QUEUE MOVES UP IN ORDER, THE TOP ONE GOING INTO
174 REM * THE 'READY' QUEUE
180 DIM Q(4,2)
190 GOSUB 600
200 REM * TALK TO PERSON AND FIND OUT WHICH STORY TO USE
210 PRINT "HELLO. THIS IS THE MADLIB PROGRAM TYPING."
220 PRINT
230 PRINT "THERE ARE SEVERAL STORIES IN THIS PROGRAM. YOU CAN"
240 PRINT "GET ONE PICKED AT RANDOM, OR CHOOSE ONE YOURSELF."
250 PRINT
260 PRINT "WHICH DO YOU WANT - CHOOSE OR RANDOM ";
270 INPUT X$
280 IF X$[1,1]="C" THEN 400
290 IF X$[1,1]="R" THEN 300
292 PRINT "'CHOOSE' MEANS YOU PICK A STORY (YOU CAN ASK FOR A MENU)"
294 PRINT "'RANDOM' MEANS YOU WON'T KNOW WHAT YOU'RE GETTING"
296 GOTO 260
300 REM * THIS SECTION PICKS A RANDOM SOTRY FROM THE 'READY' QUEUE
302 REM * BEFORE RUNNING THE STORY, IT UPDATES THE 'WAIT' QUEUE
304 REM * SO THIS SOTRY WON'T BE CHOSEN AGAIN FOR A WHILE
310 Q0=INT(4*RND(0))+1
320 S=Q(Q0,1)
330 GOSUB 800
340 GOSUB 900
350 GOTO 250
400 REM * THIS SECTION ASKS THE PERSON TO CHOOSE A STORY
410 PRINT
412 PRINT "WHICH SOTRY NUMBER (TYPE A 0 TO GET A MENU) ";
414 INPUT S
416 IF S#0 THEN 420
418 GOSUB 700
419 GOTO 410
420 IF S<=S9 AND S>=1 AND INT(S)=S THEN 430
422 PRINT "SORRY, BUT THAT AIN'T ASTORY NUMBER"
424 PRINT "(HINT: TYPE A 0 TO GET THE FULL LIST)"
426 GOTO 412
430 REM & NOW, FIX THE 'READY' AND 'WAIT' QUEUES
440 REM FIRST, SEE IF IT'S IN THE 'READY' QUEUE
442 FOR Q0=1 TO 4
444 IF Q(Q0,1)=S THEN 460
446 NEXT Q0
450 REM STORY NUMBER ISN'T THERE, SO CHECK THE 'WAIT' QUEUE
452 FOR Q0=1 TO 4
454 IF Q(Q0,2)=S THEN 460
456 NEXT Q0
460 FOR Q1=1 TO 4
462 Q(Q1,2)=Q(Q1+1,2)
464 IF Q(Q1,2)=0 THEN 468
466 NEXT Q1
468 Q(Q1,2)=S
469 GOTO 480
470 REM FOUND STORY # IN 'READY' QUEUE, SO CALL THE REGULAR SUBROUTINE!
472 GOSUB 800
480 REM NOW THAT THE QUEUES HAVE BEENB UPDATED, REN STORY. THEN LOOP BACK
490 GOSUB 900
492 GOTO 250
500 REM *** SUBROUTINES START HERE ***
510 REM * THIS SUBROUTINE RESTORES THE DATA POINTER TO A PARTICULAR STORY
520 REM S IS THE # OF THE STORY TO READ FROM
530 GOTO S OF 540,544,548,522,556,560,564,566
540 RESTORE 1000
542 RETURN
544 RESTORE 2000
546 RETURN
548 RESTORE 3000
550 RETURN
552 RESTORE 4000
554 RETURN
556 RESTORE 5000
558 RETURN
560 RESTORE 6000
562 RETURN
564 RESTORE 7000
566 RETURN
568 RESTORE 8000
570 RETURN
600 REM * THIS SUBROUTEIN READS THE STORY NUMBERS INTO MAT Q
602 REM * AND FINDS THE TOTAL # OF STORIES
610 REM S9 IS THE TOTAL # OF STORIES
620 MAT Q=ZER
622 FOR S=1 TO 8
624 GOSUB 500
626 READ Y$
628 IF Y$="*" THEN 640
630 Q[S-4*INT(S/5),1+INT(S/5)]=5
632 NEXT S
640 S9=S-1
650 IF S9<5 THEN 670
660 RETURN
670 PRINT "THERE MUST BE AT LEAST 5 STORIES IN THIS PROGRAM."
680 PRINT "ALL THERE ARE IS";S9;"STORIES. BYE !"
690 STOP
700 REM * THIS SUBROUTINE PRINTS ALL STORY TITLES
710 PRINT
712 PRINT "HERE'S THE MENU :"
714 PRINT
720 FOR S=1 TO S9
722 GOSUB 500
724 READ Y$
726 PRINT S;Y$
728 NEXT S
730 RETURN
800 REN * THIS SUBROUTINE RUNS THE SELECTED STORY
910 GOSUB 500
911 I=0
912 REM SKIP TO QUERIES BY READING TITLE
914 READ Y$
920 REM FIRST, GET ALL QUERIES FOR INPUT
922 READ Y$
924 IF Y$="*" THEN 991
926 PRINT Y$;
928 I=I+1
930 GOTO I OF 932,935,940,944,948,952,956,960,964,968,972,976,980,984,8
932 INPUT A$
934 GOTO 990
936 INPUT B$
938 GOTO 990
940 INPUT C$
942 GOTO 990
944 INPUT D$
946 GOTO 990
948 INPUT E$
950 GOTO 990
952 INPUT F$
954 GOTO 990
956 INPUT G$
958 GOTO 990
960 INPUT H$
962 GOTO 990
964 INPUT I$
966 GOTO 990
968 INPUT J$
970 GOTO 990
972 INPUT K$
974 GOTO 990
976 INPUT L$
978 GOTO 990
980 INPUT M$
982 GOTO 990
984 INPUT N$
986 GOTO 990
988 INPUT O$
990 GOTO 920
991 REM NOW, PRINT TITLE & GOSUB THE STORY - LET IT RUN ITSELF!
992 GOSUB 500
993 READ Y$
994 PRINT LIN(-5);TAB((45-LEN(Y$))/2);Y$
995 PRINT LIN(-3)
996 GOSUB OF 1000,2000,3000,4000,5000,6000,7000,8000
999 RETURN
1000 REM *** WEATHER ***
1002 REM * FIRST, THE TITLE
1010 DATA "WEATHER REPORT"
1020 REM * SECOND, THE QUERIES FOR INPUT
1030 DATA "GIVE ME A PLACE"
1040 DATA "GIVE ME A TEMPERATURE"
1050 DATA "NOW I NEED A VERB"
1060 DATA "WHAT IS YOUR NAME"
1499 DATA "*"
1500 REM * AND THIRD, THE STORY GETS PRINTED OUT
1502 PRINT " GOOD EVENING, TV VIEWERS. THIS IS THE EVENING"
1510 PRINT "WEATHER REPORT FOR ";A$;" AND VICINITY."
1512 PRINT
1520 PRINT "THE ";B$;" WILL BE WARM, AND THE HUMIDITY IN THE LOW"
1530 PRINT "30'S. THERE WILL BE A SLIGHT RAIN THAT WILL ";C$
1540 PRINT "AND THAT IS ALL."
1550 PRINT
1560 PRINT " SIGNING OFF FOR KLMN TV,THIS IS ";D$
1999 RETURN
2000 REM *** STAR TREK ***
2002 REM * FIRST, THE TITLE
2010 DATA "STAR TREK INTRODUCTION:
2020 REM * SECOND, THE QUERIES FOR INPUT
2030 DATA "I NEED A FAMOUS NAME"
2040 DATA "WHAT WOULD YOU LIKE TO DOMOST OF ALL "
2050 DATA "LEAST OF ALL "
2060 DATA "GIVE ME A NAME "
2070 DATA "AND A DATE"
2080 DATA "A NAME OF A DISTANT PLACE"
2090 DATA "THE NAME OF YOUR BEST FRIEND"
2499 DATA "*"
2500 REM * AND THIRD, THE STORY GETS PRINTED OUT
2502 PRINT "SPACE, THE FINAL FRONTIER"
2510 PRINT "THESE ARE THE VOYAGES OF THE STARSHIP ";A$
2520 PRINT "ITS FIVE-YEAR MISSION : ";B$
2530 PRINT "TO SEEK OUT NEW LIFE AND CIVILIZATIONS,"
2540 PRINT "TO ";C$;". . ."
2542 PRINT "TO BOLDLY GO WHERE NO MAN HAS GONE BEFORE . . . "
2550 PRINT
2560 PRINT TAB(15);"S T A R T R E K "
2570 PRINT
2580 PRINT "CAPTAIN ";D$;": CAPTAIN'S LOG, STARDATE ";E$
2590 PRINT
2600 PRINT " WE ARE RESPONDING TO A DISTRESS CALL FROM THE"
2610 PRINT "SCIENTIFIC EXPIDITION TO ";F$
2620 PRINT
2630 PRINT "CAPTAIN ";D$;": LIEUTENANT ";G$;", PLEASE TAKE OVER"
2640 PRINT " THE HELM WHILE MR. SPOCK AND I BEAM DOWN"
2650 PRINT " TO INVESTIGATE.:
2660 PRINT
2670 PRINT TAB(5);"C O M M E R C I A L B R E A K "
2999 RETURN
3000 REM *** COMPUTER TALK
3002 REM * FIRST, THE TITLE
3010 DATA "COMPUTER TALK"
3020 REM * SECOND, THE QUERIES FOR INPUT
3030 DATA "I NEED A WORD FOR SOMETHING BIG "
2040 DATA "NOW A WORD FOR A LITTLE ONE "
2050 DATA "GIVE ME A SHORT, SECRET MESSAGE "
3060 DATA "WHAT'S ANOTHER WORD FOR 'PREPARE' "
3070 DATA "WHO WOULD PREPARE IT "
3080 DATA "ANOTHER WORD FOR MESSAGE "
3090 DATA "A PERSON IN CHARE IS CALLED A . . . "
3100 DATA "GIVE ME A NUMBER "
3110 DATA "ANOTHER NUMBER "
3120 DATA "SOMETHING VERY IMPORTANT "
3130 DATA "I NEED AN ACTION WORD "
3499 DATA "*"
3500 REM * AND THIRD, THE STORY GETS PRINTED OUT
3510 PRINT " THE 3-BIT ";A$;" GENERATES THE CONTROL SIGNALS:
3520 PRINT "FOR THE ";B$;" BY A DECODING OF THE ";C$;"."
3530 PRINT "IT IS LOADED A ";D$;" BY A ";E$; " AND THEREFORE"
3540 PRINT "THE TIMING OF I/O ";F$;" IS UNDER ";G$;"."
3550 PRINT
3560 PRINT " THERE ARE "H$;" OUTPUT MODES AND ";I$;" INPUT MODES."
3570 PRINT "THE HIGH ORDER "I$;" OF THE REGISTER IS THE INPUT FLAG."
3580 PRINT "WHEN THIS ";J$;" IS A 1-BIT, THE ";J$;" IS"
3590 PRINT "SUBSTITUTED FOR THE ";A$;", THUS PROVIDING A SOURCE"
3600 PRINT "OF DATA WHEN ";K$;" AND EXTERNAL I/O ";F$;"."
3999 RETURN
4000 REM *** NOW TO <BLANK> YOUR FIRST <BLANK> PROGRAM ***
4002 REM * FIRST, THE TITLE
4010 DATA "HOW TO <BLANK> YOUR FIRST <BLANK> PROGRAM"
4020 REM * SECOND, THE QUERIES FOR INPUT
4030 DATA "GIVE ME A VERB RELATED TO MOTION "
4040 DATA "GIVE ME A WORD WHICH MEANS APPROVAL "
4050 DATA "NOW A WORD FOR A HEAVY MACHINE "
4060 DATA "HOW ABOUT SOMETHING LIGHT "
4070 DATA "NOW A WORD FOR MECHANICAL CONNECTIONS OR FORCES "
4080 DATA "SOMETHING YOU LIKE ALOT "
4090 DATA "AND SOMETHING YOU HATE "
4499 DATA "*"
4500 REM * AND THIRD, THE STORY GETS PRINTED OUT
4510 PRINT " FIRST, YOU HAVE TO LOGO THE ";C$;". ONCE YOU"
4520 PRINT "HAVE ";E$;" THE ";G$;" WORD, THEN "A$;" THE"
4530 PRINT "NOUN."
4540 PRINT
4550 PRINT " NEXT, SCRATCH THE ";C$;" AND ENTER YOUR ";D$;"."
4560 PRINT "ONCE ENOUGH ";D$;"S ARE ENTERED, IT'S TIME TO"
4570 PRINT A$;" YOUR ";C$;" UNTIL YOU LOOP THE ";F$;" OR"
4580 PRINT E$;"ED YOUR ";B$;" PROGRAM."
4999 RETURN
5000 REM *** HOW TO WIN FRIENDS AND INFLUENCE PEOPLE ***
5002 REM * FIRST, THE TITLE
5010 DATA "HOW TO WIND FRIENDS AND INFLUENCE PEOPLE"
5030 REM * SECOND, THE QUERIES FOR INPUT
5040 DATA "NAME SOMETHING YOU'VE ALWAYS WANTED TO DO "
5050 DATA "NOW A PART OF A PERSON "
5060 DATA "ANOTHER PART OF A PERSON "
5070 DATA "GIVE ME A 1-WORD EXCLAMATION "
5080 DATA "WHAT'S THE BEST WORD FOR A BAD DAY "
5090 DATA "A TYPE OF PERSON "
5100 DATA "AN ACTION WORD "
5110 DATA "I NEED EVEN ANOTHER PART OF A PERSON "
5120 DATA "A DESCRIPTIVE WORD "
5130 DATA "NAME SOMETHING "
5140 DATA "WHAT DO PEOPLE DO "
5150 DATA "SOMETHING THAT PEOPLE NOTICE "
5160 DATA "SOMETHING YOU LIKE TO DO "
5170 DATA "ANOTHER THING YOU DON'T LIKE TO DO "
5499 DATA "*"
5500 REM * AND THIRD, THE STORY GETS PRINTED OUT
5510 PRINT " TO CHANGE PEOPLE, YOU MUST ";A$;" WITH THEM."
5520 PRINT "THERE ARE A NUMBER OF WAYS TO GO ABOUT CHANGING"
5530 PRINT "A PERSON'S ";B$;". WALK UP TO THEM ON THE STREET,"
5540 PRINT "GRAB THEM BY THE ";C$;" AND YELL '";D$;"!!!', YOU"
5550 PRINT E$;" ";F$;"! OR CATCH THEM ASLLEEP AND WHISPER,"
5560 PRINT "'";G$;", ";G$;", ";G$;"' IN THEIR ";H$
5570 PRINT "OR SET YOURSELF UP AS A ";I$;" ";J$;" AND"
5580 PRINT "PRETTY SOON PEOPLE WILL START TO ";;K$;"."
5590 PRINT "TO WORK THIS ALTERNATIVE. THOUGH, YOU MUST EITHER"
5600 PRINT "HAVE A ";L$;" YOU CAN CHANGE SOCIETY WITH, OR"
5610 PRINT "DO A ";M$;" OR A ";N$;". BUY ONLY IF YOU AREN'T"
5620 MISTAKEN FOR A ";E$;" ";F$;"."
5999 RETURN
6000 REM *** ATOP THE NARGOIDS
6002 REM * FIRST, THE TITLE
6010 DATA "ATOP THE NARGOIDS"
6002 REM * FIRST, THE TITLE
6010 DATA "ATOP THE NARGIODS"
6020 REM * SECOND, THE QUERIES FOR INPUT
6499 DATA "*"
6500 REM * AND THIRD, THE STORY GETS PRINTED OUT
6999 RETURN
7000 REM *** EMPTY STORY ***
7999 DATA "*"
8000 REM *** EMPTY STORY ***
8999 DATA "*"
9999 END