-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAVOIDOBW.txt
45 lines (45 loc) · 957 Bytes
/
AVOIDOBW.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
Menu("Avoid the O!","Play",1,"About",2
Lbl 1
ClrHome
1→A
1→B
randInt(3,8)→C
randInt(3,16)→D
randInt(3,8)→I
randInt(3,16)→J
Repeat (K=22) or (A=C and B=D) and (C=A and D=B) or (A=I and B=J) and (I=A and J=B)
Output(C,D," ")
min(8,max(1,C+randInt(⁻1,1)))→C
min(16,max(1,D+randInt(⁻1,1)))→D
Output(C,D,"O")
Output(I,J," ")
min(8,max(1,I+randInt(⁻1,1)))→I
min(16,max(1,J+randInt(⁻1,1)))→J
Output(I,J,"W")
getKey→K
If Ans
Output(A,B," ")
min(8,max(1,A+sum(DeltaList(Ans={25,34→A
min(16,max(1,B+sum(DeltaList(K={24,26→B
Output(A,B,"X")
If (A=C and B=D) and (C=A and D=B)
Then
ClrHome
Output(4,5,"You lose!")
Pause ""
End
If (A=I and B=J) and (I=A and J=B)
Then
ClrHome
Output(4,5,"You win!")
Pause ""
End
End
ClrHome
Stop
Lbl 2
ClrHome
Output(1,1,"To play, use the D-pad. Avoid the O's and try to reach the W. To quit, press MODE. Press Enter to exit this menu.")
Pause ""
ClrHome
Stop