-
Notifications
You must be signed in to change notification settings - Fork 2
/
NEWmastermind.kbs
337 lines (328 loc) · 5.16 KB
/
NEWmastermind.kbs
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
TRYA = 1
TRYB = 1
TRYC = 1
TRYD = 1
TRYE = 1
COLOR RED
PRINT "^mastermind^"
print " "
START:
A = INT(RAND*5)
B = INT(RAND*5)
C = INT(RAND*5)
D = INT(RAND*5)
DIM RIGHT$(6)
RIGHT$ = {"G","Y","B","P","C","0"}
r = 8
a = 53
t = 53
b =103
c = 153
d = 203
e = 253
rem ------
dim fh(10)
dim fr(10)
fr = {38, 88, 138, 188, 238, 38, 88, 138, 188, 238}
fh = {38, 88, 138, 188, 238, 38, 88, 138, 188, 238}
j = 38
k = 38
ja = 38
ka = 38
aa = 38
ab = 38
l = 137
m = 147
la = l + 25
ma = m + 25
n = 2
rem ------
L = 36.5
R = 30
rem ----
f = 192
g = 217
h = 242
i = 267
rem ----
fa = f - 150
ga = g - 150
ha = h - 150
ia = i - 150
clg
print "Caps Sensistive"
PRINT "G = GREEN"
PRINT "Y = YELLOW"
PRINT "B = BLUE"
PRINT "P = PURPLE"
PRINT "C = CYAN"
PRINT "O = ORANGE"
print " "
background:
color white
rect 10, 10, 300, 10
rect 10, 10, 10, 300
rect 289, 10, 10, 300
rect 10, 289, 290, 10
color black
rect 10, 10, 299, 9
rect 10, 10, 9, 299
rect 290, 10, 10, 300
rect 10, 290, 290, 10
LINE 10, 154, 300, 154
boxes:
FOR K = 1 TO 5
rect L, R, 35, 100
rect L, R+150, 35, 100
L = L + 50
NEXT K
REM NOW STARTING LOGICAL SECTION OF PROGRAM -------------------------------
IT:
FOR Z = 1 TO 5
input "FIRST COLOR? ", CA$
input"SECOND COLOR? ",CB$
input "THIRD COLOR? ",CC$
input "FOURTH COLOR? ",CD$
IF CA$ = RIGHT$[A] AND CB$ = RIGHT$[B] AND CC$ = RIGHT$[C] AND CD$ = RIGHT$[D] THEN PRINT "CONGRATS! YOU SOLVED THE PUZZLE!" : END
IF CA$ = RIGHT$[A] OR CB$ = RIGHT$[A] OR CC$ = RIGHT$[A] OR CD$ = RIGHT$[A] THEN TRYA = 1 : GOTO NEXTONE
TRYA = 0
NEXTONE:
IF CA$ = RIGHT$[B] OR CB$ = RIGHT$[B] OR CC$ = RIGHT$[B] OR CD$ = RIGHT$[B] THEN TRYB = 1 : GOTO NEXTTWO
TRYB = 0
NEXTTWO:
IF CA$ = RIGHT$[C] OR CB$ = RIGHT$[C] OR CC$ = RIGHT$[C] OR CD$ = RIGHT$[C] THEN TRYC = 1 : GOTO NEXTTHREE
TRYC = 0
NEXTTHREE:
IF CA$ = RIGHT$[D] OR CB$ = RIGHT$[D] OR CC$ = RIGHT$[D] OR CD$ = RIGHT$[D] THEN TRYD = 1 : GOTO CONTINUE
TRYD = 0
IF CA$ = RIGHT$[A] OR CB$ = RIGHT$[B] OR CC$ = RIGHT$[C] OR CD$ = RIGHT$[D] THEN TRYE = 1
IF CA$ = RIGHT$[A] AND CB$ = RIGHT$[B] THEN TRYE = 2
IF CA$ = RIGHT$[A] AND CB$ = RIGHT$[B] AND CC$ = RIGHT$[C] THEN TRYE = 3
IF CA$ = RIGHT$[A] AND CC$ = RIGHT$[C] AND CD$ = RIGHT$[D] THEN TRYE = 3
IF CA$ = RIGHT$[A] AND CB$ = RIGHT$[B] AND CD$ = RIGHT$[D] THEN TRYE = 3
IF CB$ = RIGHT$[B] AND CC$ = RIGHT$[C] THEN TRYE = 2
IF CB$ = RIGHT$[B] AND CC$ = RIGHT$[C] AND CD$ = RIGHT$[D] THEN TRYE = 3
IF CC$ = RIGHT$[C] AND CD$ = RIGHT$[D] THEN TRYE = 2
IF CA$ = RIGHT$[A] AND CD$ = RIGHT$[D] THEN TRYE = 2
IF CB$ = RIGHT$[B] AND CD$ = RIGHT$[D] THEN TRYE = 2
IF CC$ = RIGHT$[C] AND CD$ = RIGHT$[D] THEN TRYE = 2
CONTINUE:
FINAL = TRYA + TRYB + TRYC + TRYD
goto check
next1:
goto check2
next2:
j = fr[Z]
k = fr[Z]
TEST1A:
if CA$ = "G" then goto A1A
TEST1B:
if CA$ = "Y" then goto A1B
TEST1C:
if CA$ = "B" then goto A1C
TEST1D:
if CA$ = "P" then goto A1D
TEST1E:
if CA$ = "C" then goto A1E
TEST1F:
if CA$ = "O" then goto A1F
REM --------
TEST2A:
if CB$ = "G" then goto A2A
TEST2B:
if CB$ = "Y" then goto A2B
TEST2C:
if CB$ = "B" then goto A2C
TEST2D:
if CB$ = "P" then goto A2D
TEST2E:
if CB$ = "C" then goto A2E
TEST2F:
if CB$ = "O" then goto A2F
REM --------
TEST3A:
if CC$ = "G" then goto A3A
TEST3B:
if CC$ = "Y" then goto A3B
TEST3C:
if CC$ = "B" then goto A3C
TEST3D:
if CC$ = "P" then goto A3D
TEST3E:
if CC$ = "C" then goto A3E
TEST3F:
if CC$ = "O" then goto A3F
REM --------
TEST4A:
if CD$ = "G" then goto A4A
TEST4B:
if CD$ = "Y" then goto A4B
TEST4C:
if CD$ = "B" then goto A4C
TEST4D:
if CD$ = "P" then goto A4D
TEST4E:
if CD$ = "C" then goto A4E
TEST4F:
if CD$ = "O" then goto A4F
IF ia = i and a > 252 then CLS : PRINT "SORRY, YOU LOSE!" : end
IF Z = 5 THEN GOTO MOVEDOWN
IF Z > 0 AND Z < 5 THEN a = a + 50
CLS
NEXT Z
END
MOVEDOWN:
CLS
a = t
fa = f
ga = g
ha = h
ia = i
l = la
m = ma
GOTO IT
BOX1COLOR1:
A1A:
color green
circle a, fa, r
GOTO TEST1B
end
A1B:
color yellow
circle a, fa, r
GOTO TEST1C
end
A1C:
color blue
circle a, fa, r
GOTO TEST1D
end
A1D:
color purple
circle a, fa, r
GOTO TEST1E
end
A1E:
color darkcyan
circle a, fa, r
GOTO TEST1F
end
A1F:
color orange
circle a, fa, r
GOTO TEST2A
end
BOX1COLOR2:
A2A:
color green
circle a, ga, r
GOTO TEST2B
end
A2B:
color yellow
circle a, ga, r
GOTO TEST2C
end
A2C:
color blue
circle a, ga, r
GOTO TEST2D
end
A2D:
color red
circle a, ga, r
GOTO TEST2E
end
A2E:
color darkcyan
circle a, ga, r
GOTO TEST2F
end
A2F:
color orange
circle a, ga, r
GOTO TEST3A
end
BOX1COLOR3:
A3A:
color green
circle a, ha, r
GOTO TEST3B
end
A3B:
color yellow
circle a, ha, r
GOTO TEST3C
end
A3C:
color blue
circle a, ha, r
GOTO TEST3D
end
A3D:
color red
circle a, ha, r
GOTO TEST3E
end
A3E:
color darkcyan
circle a, ha, r
GOTO TEST3F
end
A3F:
color orange
circle a, ha, r
GOTO TEST4A
end
BOX1COLOR4:
A4A:
color green
circle a, ia, r
GOTO TEST4B
end
A4B:
color yellow
circle a, ia, r
GOTO TEST4C
end
A4C:
color blue
circle a, ia, r
GOTO TEST4D
end
A4D:
color red
circle a, ia, r
GOTO TEST4E
end
A4E:
color darkcyan
circle a, ia, r
GOTO TEST4F
end
A4F:
color orange
circle a, ia, r
end
check:
color white
for i = 1 to FINAL
circle j, l, n
j = j + 10
next i
goto next1
end
check2:
color red
for i = 1 to TRYE
circle k, m, n
k = k + 10
next i
goto next2
end
rem -------
color red
circle j, l, n
circle k, l, n
circle j, m, n
circle k, m, n