Hi guys,
It's time to release the official version of Guess Number!
After 18 days of development and 5 test versions, this game is finally released. Although it may still have some bugs, I will try to fix them one by one.
Here is the code:
- Main menu / game core (Filename:Guess Number)
1→P
Locate 3,1,"Guess Number"
Locate 1,4,"Ver.1.0.0"
Do
Cls
P=1⇒Locate 4,2,">New game<"
P=2⇒Locate 4,2,">Continue<"
P=3⇒Locate 4,2,">Settings<
Getkey→K
K=84 And P>1⇒Dsz P
K=85 And P<3⇒Isz P
If (P=1 Or P=2) And K=47
Then If J≠0 And P=1
Then Cls
"WARNING! This"
Locate 1,2,"covers progress!"
Locate 1,3,"Sure?"
Locate 1,4,"[1]:yes [0]:no"
Getkey→T
Do
LpWhile T≠35 And T≠25
T=35⇒0→J
IfEnd
If J=0
Then Cls
"<Back"
Locate 1,2,"[1]:BullsAndCows"
Locate 1,3,"[2]:Range"
Do
Getkey→K
LpWhile K≠35 And K≠36 And K≠83
IfEnd
K=35 Or J=1⇒Prog "gn.game1"
K=36 Or J=2⇒Prog "gn.game2"
I=N Or X=4 Or M=0⇒Prog "gn.pg"
IfEnd
P=3 And K=47⇒Prog "gn.set"
LpWhile 1
- Settings menu (Filename:gn.set)
Do
Cls
"<Back"
Locate 1,2,"[1]:config."
Locate 1,3,"[2]:reset all"
Getkey→K
If K=35 Or K=36
Then Cls
"Sure?"
Locate 1,3,"[1]:yes"
Locate 1,4,"[0]:no"
Do
Getkey→T
LpWhile T≠25 And T≠35
IfEnd
If K÷T=1
Then Do
Cls
"Move limit"?L
Int(L→L
LpWhile L<1 Or L>99
Do
Cls
"Min. range"?Q
Int(Q→Q
Cls
"Max. range"?R
Int(R→R
LpWhile Q<1 Or R<1 Or R-Q<2 Or R>E4
Do
Cls
"0:false"
Locate 1,2,"1:true"
"Allow rp. num."?U
Int(U→U
LpWhile U≠0 Or U≠1
Prog "gn.done"
IfEnd
If K-T=1
Then ClrMemory
1→P
8→L
1→Q
E2→R
Prog "gn.done"
IfEnd
LpWhile K≠83
Return
- Bulls and Cows (Filename:gn.game1)
If J=0
Then Do
RanInt#(0,9→A
RanInt#(0,9→B
RanInt#(0,9→C
RanInt#(0,9→D
LpWhile U=0 And (A=B Or A=C Or A=D Or B=C Or B=D Or C=D)
L→M
1→J
IfEnd
Do
M=0⇒Break
Prog "gn.clear"
Prog "gn.disp"
Do
Cls
E≧0⇒Locate 7,2,E
F≧0⇒Locate 8,2,F
G≧0⇒Locate 9,2,G
H≧0⇒Locate 10,2,H
Prog "gn.check"
I=0 And O And U=0⇒Isz S
I And O And U=0⇒S-I10^(I→S
LpWhile K≠47 And A≧0 And B≧0 And C≧0 And D≧0
(A=E)+(B=F)+(C=G)+(D=H→X
(A=F)+(A=G)+(A=H)+(B=E)+(B=G)+(B=H)+(C=E)+(C=F)+(C=H)+(D=E)+(D=F)+(D=G→Y
LpWhile X≠4M-
Return
- Range (Filename:gn.game2)
If J=0
Then RanInt#(Q+1,R-1→N
Q→X
R→Y
L→M
2→J
IfEnd
Do
M=0⇒Break
Prog "gn.clear"
Prog "gn.disp"
Do
Cls
Locate 7,2,Z
Getkey→K
Prog "gn.check"
LpWhile K≠47 And Z>X And Z<Y
I<K⇒I→X
I>K⇒I→Y
LpWhile I≠NM-
Return
- Display (Filename:gn.disp)
Cls
E3E+E2F+10G+H→Z
"Moves:"
Locate 7,1,M
Locate 1,2,"Input:"
Locate 7,2,Z
Locate 1,3,"A:"
Locate 3,3,X
Locate 1,4,"B:"
Locate 3,4,Y
IfEndâ—¢
Return
- Substitution & check (Filename:gn.check)
Getkey→K
K=25⇒0→I
K>34 And K<38⇒K-34→I
K>20 And K<24⇒K-17→I
K>30 And K<34⇒K-24→I
If K=34
Then Prog "gn.clear"
Return
IfEnd
If E<0
Then I→E
1→O
Return
IfEnd
If F<0
Then I→F
1→O
Return
IfEnd
If G<0
Then I→G
1→O
Return
IfEnd
If H<0
Then I→H
1→O
Return
IfEnd
- Clear (Filename:gn.clear)
0→U
0→Z
-1→E
-1→F
-1→G
-1→H
9876543210→S
Return
- Done notification (Filename:gn.done)
Cls
"Done"
Locate 1,4,"<Back"
Do
LpWhile Getkey≠83
Return
- Post-gameplay (Filename:gn.pg)
Cls
0→J
Locate 1,1,"Moves:"
If M≠0
Then Locate 7,1,L-M+1
Locate 1,2,"Out of"
Locate 8,2,L
Else "No moves"
IfEnd
Locate 1,3,"Ans:"
J=1⇒Locate 5,3,E3A+E2B+10C+D
J=2⇒Locate 5,3,N
Locate 1,4,"[EXE]:back"â—¢
Return
If you find any bugs, please report them on this thread, thanks.
Hope you enjoy!
Best regards,
CalcLoverHK
Edited by CalcLoverHK, 15 July 2019 - 09:12 AM.