-
Notifications
You must be signed in to change notification settings - Fork 0
/
MATHTOWN.8xp
272 lines (270 loc) · 6.52 KB
/
MATHTOWN.8xp
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
Repeat 0
RectGC
CoordOn
GridLine MEDGRAY
AxesOn BLACK
BackgroundOff
BorderColor 1
ZStandard
FnOff
PlotsOff
Horiz
LabelOff
ExprOn
If 0
0→C
{10}→⌊SIZE
TextColor(BLACK)
Menu("WELCOME TO MATHTOWN! V 1.0","NEW GAME",N,"LOAD SAVE",L,"CLEAR SAVES",C,"ABOUT",A,"QUIT GAME",Q)
Lbl N
"NEWGAME
Menu("SKIP THE TUTORIAL? (Y/N)","Y",NZ,"N",NT)
Lbl NT
"NEW GAME TUTORIAL
ClrHome
ClrDraw
DispGraph
Disp "MATHTOWN IS A GAME WHERE","YOU GROW YOUR MATHTOWN BY"
Pause "PRESS ENTER TO CONTINUE."
ClrHome
Disp "EARNING MATHCOIN.",""
Pause "PRESS ENTER TO CONTINUE."
0→X
{0}→⌊XOTER
{0}→⌊YOTER
{0,2}→⌊XPARK
{0,1}→⌊YPARK
Plot2(Scatter,⌊XPARK,⌊YPARK,⁺,GREEN)
Plot3(Scatter,⌊XOTER,⌊YOTER,▫,BLUE)
DispGraph
Repeat X=√(5)
:ClrHome
:Disp "TWO POINTS ARE SHOWN- AT","(0,0) AND (2,1). WHAT IS"
:Input "THE LENGTH BETWEEN THEM? ",X
End
ClrHome
Line(0,0,2,1,1,GREEN)
Disp "NICE WORK!",""
Pause "PRESS ENTER TO CONTINUE."
Repeat dim(⌊XPARK)=4 and dim(⌊YPARK)=4
:ClrHome
:Disp "NOW, GIVE COORDINATES FOR","TWO POINTS THAT CAN FORM A"
:Pause "PRESS ENTER TO CONTINUE."
:ClrHome
:Disp "SQUARE WITH THESE TWO.","INPUT IN LIST FORM ({8,4})"
:Input "X-COORDINATES:",⌊TEMPX
:Input "Y-COORDINATES:",⌊TEMPY
:If min(⌊TEMPX={1,1}) and min(⌊TEMPY={2,3}) or min(⌊TEMPX={1,1}) and min(⌊TEMPY={3,2}) or min(⌊TEMPX={1,3}) and min(⌊TEMPY={2,1}) or min(⌊TEMPX={3,1}) and min(⌊TEMPY={1,2})
Then
::augment(⌊XPARK,⌊TEMPX)→⌊XPARK
::augment(⌊YPARK,⌊TEMPY)→⌊YPARK
:End
End
ClrList ⌊TEMPX,⌊TEMPY
Line(⌊XPARK(1),⌊YPARK(1),⌊XPARK(2),⌊YPARK(2),1,GREEN)
Line(⌊XPARK(1),⌊YPARK(1),⌊XPARK(3),⌊YPARK(3),1,GREEN)
Line(⌊XPARK(1),⌊YPARK(1),⌊XPARK(4),⌊YPARK(4),1,GREEN)
Line(⌊XPARK(2),⌊YPARK(2),⌊XPARK(3),⌊YPARK(3),1,GREEN)
Line(⌊XPARK(2),⌊YPARK(2),⌊XPARK(4),⌊YPARK(4),1,GREEN)
Line(⌊XPARK(3),⌊YPARK(3),⌊XPARK(4),⌊YPARK(4),1,GREEN)
DispGraph
Disp "GREAT! YOU'VE MADE A PARK.","THE TUTORIAL IS NOW DONE."
Pause "PRESS ENTER TO CONTINUE."
{1,1,1}→⌊Q
startTmr→Q
Goto LZ
Lbl NZ
"NEW GAME, NO TUTORIAL
{0}→⌊XPARK
{0}→⌊YPARK
{0}→⌊XOTER
{0}→⌊YOTER
If 0
{1,1,1}→⌊Q
startTmr→Q
"PARK W/ AREA "+eval(randInt(1,⌊SIZE(1)))→Str7
"FLOWERBED"→Str8
randInt(1,dim(⌊XOTER))→R
"HOSPITAL "+eval(randInt(1,⌊SIZE(1)))+" FROM ("+eval(⌊XOTER(R))+","+eval(⌊YOTER(R))+")"→Str9
Goto LZ
Lbl L
"LOAD GAME
Full
ClrHome
Disp "PLEASE NOTE: ATTEMPTING TO","LOAD AN EMPTY SAVE WILL","RESULT IN AN UNDEFINED","ERROR.","","",""
Pause "PRESS ENTER TO CONTINUE."
Menu("LOAD GAME","SAVE A",LA,"SAVE B",LB,"SAVE C",LC,"BACK",θ)
Lbl LA
"LOAD GAME A
Horiz
Matrlist([H],⌊XPARK,⌊YPARK,⌊XOTER,⌊YOTER,⌊SIZE)
Plot2(Scatter,⌊XPARK,⌊YPARK,⁺,GREEN)
Plot3(Scatter,⌊XOTER,⌊YOTER,▫,BLUE)
Goto LZ
Lbl LB
"LOAD GAME B
Horiz
Matrlist([I],⌊XPARK,⌊YPARK,⌊XOTER,⌊YOTER,⌊SIZE)
Plot2(Scatter,⌊XPARK,⌊YPARK,⁺,GREEN)
Plot3(Scatter,⌊XOTER,⌊YOTER,▫,BLUE)
Goto LZ
Lbl LC
"LOAD GAME C
Matrlist([J],⌊XPARK,⌊YPARK,⌊XOTER,⌊YOTER,⌊SIZE)
Plot2(Scatter,⌊XPARK,⌊YPARK,⁺,GREEN)
Plot3(Scatter,⌊XOTER,⌊YOTER,▫,BLUE)
Goto LZ
Lbl LZ
"LOADED GAME
⌊SIZE(1)→S
Repeat 0
While dim(⌊XPARK)>1 and dim(⌊YPARK)>1 and ⌊XPARK(dim(⌊XPARK))=0 and ⌊YPARK(dim(⌊YPARK))=0
dim(⌊XPARK)-1→dim(⌊XPARK)
dim(⌊YPARK)-1→dim(⌊YPARK)
End
While dim(⌊XOTER)>1 and dim(⌊YOTER)>1 and ⌊XOTER(dim(⌊XOTER))=0 and ⌊YOTER(dim(⌊YOTER))=0
dim(⌊XOTER)-1→dim(⌊XOTER)
dim(⌊YOTER)-1→dim(⌊YOTER)
End
For(I,0,dim(⌊XPARK)-4,4)
Line(⌊XPARK(I+1),⌊YPARK(I+1),⌊XPARK(I+2),⌊YPARK(I+2),1,GREEN)
Line(⌊XPARK(I+1),⌊YPARK(I+1),⌊XPARK(I+3),⌊YPARK(I+3),1,GREEN)
Line(⌊XPARK(I+1),⌊YPARK(I+1),⌊XPARK(I+4),⌊YPARK(I+4),1,GREEN)
Line(⌊XPARK(I+2),⌊YPARK(I+2),⌊XPARK(I+3),⌊YPARK(I+3),1,GREEN)
Line(⌊XPARK(I+2),⌊YPARK(I+2),⌊XPARK(I+4),⌊YPARK(I+4),1,GREEN)
Line(⌊XPARK(I+3),⌊YPARK(I+3),⌊XPARK(I+4),⌊YPARK(I+4),1,GREEN)
End
Fill(⌊SIZE(1),⌊SIZE)
S→Xmax
S→Ymax
S→Xmin
S→Ymin
DispGraph
Menu("MATHTOWN","VIEW MAP",LM,"QUESTS",LQ,"STORE",LS,"QUIT GAME",Lθ)
Lbl LM
"MAP
Full
DispGraph
Text(150,1,"PRESS ENTER.")
Text(150,100,"EACH TICK IS "+eval(Xscl)+" BLOCKS.")
Repeat getKey=105:End
Horiz
Goto LX
Lbl LQ
"QUESTS
Menu("QUESTS","QUEST 1",QA,"QUEST 2",QB,"QUEST 3",QC,"BACK",LX)
Lbl QA
ClrHome
Menu("QUEST 1: BUILD A "+Str7,"BACK",LZ)
Lbl QB
Lbl QC
Lbl LS
"STORE
Menu("STORE: "+eval(C)+" MATHCOIN","TERRITORY",ST,"DECORATIONS",SD,"BACK",LX)
Lbl ST
ClrHome
Disp "HOW MUCH TERRITORY DO YOU"
Input "WANT TO BUY? ",X
If C≥X
Then
S+X→S
C-X→C
int(S/20)+1→Xscl
Xscl→Yscl
Else
Disp "YOU DON'T HAVE ENOUGH","MATHCOIN TO DO THAT!"
Pause "PRESS ENTER TO CONTINUE."
End
Goto LX
Lbl Lθ
"QUIT GAME
max({dim(⌊XPARK),dim(⌊YPARK),dim(⌊XOTER),dim(⌊YOTER)})→X
X→dim(⌊XPARK)
X→dim(⌊YPARK)
X→dim(⌊XOTER)
X→dim(⌊YOTER)
X→dim(⌊SIZE)
Menu("SAVE?","SAVE A",SA,"SAVE B",SB,"SAVE C",SC,"EXIT WITHOUT SAVING",Q,"BACK",LX)
Lbl SA
"SAVE AND QUIT SAVE A
Listmatr(⌊XPARK,⌊YPARK,⌊XOTER,⌊YOTER,⌊SIZE,[H])
Goto Q
Lbl SB
"SAVE AND QUIT SAVE B
Listmatr(⌊XPARK,⌊YPARK,⌊XOTER,⌊YOTER,⌊SIZE,[I])
Goto Q
Lbl SC
"SAVE AND QUIT SAVE C
Listmatr(⌊XPARK,⌊YPARK,⌊XOTER,⌊YOTER,⌊SIZE,[J])
Goto Q
Lbl LX
"RESET
End
Lbl C
"CLEAR GAME
Menu("CLEAR SAVES","SAVE A",CA,"SAVE B",CB,"SAVE C",CC,"BACK",θ)
Lbl CA
"CLEAR GAME A
Menu("SAVE A","CLEAR SAVE?",ZA,"BACK",θ)
Lbl ZA
"CLEAR GAME A CONFIRMED
DelVar [H]
Goto CZ
Lbl CB
"CLEAR GAME B
Menu("SAVE B","CLEAR SAVE?",ZB,"BACK",θ)
Lbl ZB
"CLEAR GAME B CONFIRMED
DelVar [I]
Goto CZ
Lbl CC
"CLEAR GAME C
Menu("SAVE C","CLEAR SAVE?",ZC,"BACK",θ)
Lbl ZC
"CLEAR GAME C CONFIRMED
DelVar [J]
Goto CZ
Lbl CZ
"GAME CLEARED
ClrHome
Pause "SAVE CLEARED. PRESS ENTER."
Goto θ
Lbl A
"ABOUT PAGES
Menu("ABOUT MATHTOWN","USER MANUAL",AM,"ABOUT",AA,"CHANGELOG",AC,"BACK",θ)
Lbl AM
"MANUAL
ClrHome
Full
Disp "MATHTOWN USER MANUAL","OBJECTIVE: INCREASE YOUR","MATHTOWN BY EARNING","MATHCOIN. THIS IS DONE BY","USING THE PYTHAGOREAN","THEOREM TO BUILD PARKS,","HOSPITALS, SCHOOLS, ETC.","PRESS ENTER TO RETURN TO"
Pause "THE HOMEPAGE."
Horiz
Goto θ
Lbl AA
"ABOUT
ClrHome
Full
Disp "MATHTOWN IS JUST THIS","THING I MADE WHEN I WAS","BORED IN MATH CLASS, YOU","KNOW?","THAT'S ALL IT IS.","I'M JACK, BY THE WAY. JACK","MOUL.","PRESS ENTER TO RETURN TO"
Pause "THE HOMEPAGE."
Horiz
Goto θ
Lbl AC
"CHANGELOG
ClrHome
Full
Disp "MATHTOWN CHANGELOG","V 1.0:INITIAL RELEASE.","","","","","","PRESS ENTER TO RETURN TO"
Pause "THE HOMEPAGE."
Horiz
Goto θ
Lbl θ
"RETURNING TO HOMEPAGE
End
Lbl Q
"QUITTING GAME
ClrHome
ClrDraw
FnOn
ZStandard
Full
PlotsOff
Stop