-
Notifications
You must be signed in to change notification settings - Fork 11
/
syntax.zap
93 lines (82 loc) · 2.83 KB
/
syntax.zap
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
.FUNCT CAPITAL-NOUN?,WRD
EQUAL? WRD,W?DOC,W?TIP,W?RANDALL /TRUE
EQUAL? WRD,W?DOC'S,W?TIP'S,W?BILL'S /TRUE
EQUAL? WRD,W?KEMP'S,W?ZOE'S,W?MARV'S /TRUE
EQUAL? WRD,W?SHARON,W?KEMP,W?ZOE /TRUE
EQUAL? WRD,W?BLY'S,W?AMY'S,W?FROBTON /TRUE
EQUAL? WRD,W?BLY,W?AMY,W?LOWELL /TRUE
EQUAL? WRD,W?MICK'S,W?WALT'S /TRUE
EQUAL? WRD,W?MICK,W?ANTRIM,W?WALT /TRUE
EQUAL? WRD,W?DOCTOR,W?DR,W?MARV /TRUE
EQUAL? WRD,W?SIEGEL,W?BILL,W?GREENUP /TRUE
EQUAL? WRD,W?HORVAK,W?JEROME,W?THORPE /TRUE
RFALSE
.FUNCT BUZZER-WORD?,WORD
CALL QUESTION-WORD?,WORD
ZERO? STACK \TRUE
CALL NUMBER-WORD?,WORD
ZERO? STACK \TRUE
CALL NAUGHTY-WORD?,WORD
ZERO? STACK \TRUE
EQUAL? WORD,W?ALL,W?AGAIN,W?G \FALSE
PRINTI "(Sorry, but in this story you can't use the word """
PRINTB WORD
PRINTR """.)"
.FUNCT QUESTION-WORD?,WORD
EQUAL? WORD,W?WHERE \?ELS5
PRINTI "(To locate something, use the command: FIND "
PRINTD SOMETHING
PRINTR ".)"
?ELS5: EQUAL? WORD,W?WHAT,W?WHAT'S /?THN10
EQUAL? WORD,W?WHO,W?WHO'S \?ELS9
?THN10: PRINTI "(To ask about something, use the command: TELL ME ABOUT "
PRINTD SOMETHING
PRINTR ".)"
?ELS9: EQUAL? WORD,W?THAT'S,W?IT'S /?THN16
EQUAL? WORD,W?WHY,W?HOW,W?WHEN /?THN16
EQUAL? WORD,W?IS,W?DID,W?ARE /?THN16
EQUAL? WORD,W?DO,W?HAVE,W?ANY /?THN16
EQUAL? WORD,W?AM,W?I'M,W?WE'RE /?THN16
EQUAL? WORD,W?WILL,W?WAS,W?WERE /?THN16
EQUAL? WORD,W?I'LL,W?CAN,W?WHICH /?THN16
EQUAL? WORD,W?I'VE,W?WON'T,W?HAS /?THN16
EQUAL? WORD,W?YOU'RE,W?HE'S,W?SHE'S /?THN16
EQUAL? WORD,W?SHOULD,W?WOULD,W?WHEN'S /?THN16
EQUAL? WORD,W?THEY'RE,W?COULD,W?SHALL \FALSE
?THN16: PRINTI "(Please use commands"
INC 'QUESTION-WORD-COUNT
GRTR? QUESTION-WORD-COUNT,9 \?ELS22
SET 'QUESTION-WORD-COUNT,0
PRINTR "! Your commands tell the computer what you want to do in the story. You can give commands to other people in the story, too. Here are examples of commands:
TURN ON THE LAMP
LOOK UNDER THE RUG
SHARON, GIVE THE BOOK TO TIP
BILL, HELP ME
Now you can try again.)"
?ELS22: PRINTR ", not statements or questions.)"
.FUNCT NUMBER-WORD?,WRD
EQUAL? WRD,W?ZERO /?THN6
EQUAL? WRD,W?TWO,W?THREE,W?FOUR /?THN6
EQUAL? WRD,W?FIVE,W?SIX,W?SEVEN /?THN6
EQUAL? WRD,W?EIGHT,W?NINE,W?TEN /?THN6
EQUAL? WRD,W?ELEVEN,W?TWELVE,W?THIRTE /?THN6
EQUAL? WRD,W?FOURTE,W?FIFTEE,W?SIXTEE /?THN6
EQUAL? WRD,W?SEVENT,W?EIGHTE,W?NINETE /?THN6
EQUAL? WRD,W?TWENTY,W?THIRTY,W?FORTY /?THN6
EQUAL? WRD,W?FIFTY,W?SIXTY,W?EIGHTY /?THN6
EQUAL? WRD,W?NINETY,W?HUNDRE,W?THOUSA /?THN6
EQUAL? WRD,W?MILLIO,W?BILLIO,W?ONE \FALSE
?THN6: PRINTR "(Use numerals for numbers, for example ""10."")"
.FUNCT NAUGHTY-WORD?,WORD
EQUAL? WORD,W?CURSE,W?CURSES,W?CUSS /?THN6
EQUAL? WORD,W?DAMN,W?SHIT,W?FUCK /?THN6
EQUAL? WORD,W?FUDGE,W?PISS,W?PEE /?THN6
EQUAL? WORD,W?SUCK /?THN6
EQUAL? WORD,W?POO,W?SNOT,W?BASTARD \FALSE
?THN6: PRINTC 40
CALL PICK-ONE,OFFENDED
PRINT STACK
PRINTC 41
CRLF
RTRUE
.ENDI