[TI-BASIC] Just making sure I didn't miss anything...

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

[TI-BASIC] Just making sure I didn't miss anything...

Post by patz2009 »

Code: Select all

Edit: Code updated.

See: http://kvince83.tengun.net/maxboard/viewtopic.php?p=61115#61115

or scroll down :)
Tell me if you can find some optomizations. As you might be able to tell, I have taken careful work in optomizing this and it weighs in at about 2160 now.

In most cases for this program, size has more precedence than speed.
Last edited by patz2009 on Mon 03 Sep, 2007 2:29 am, edited 1 time in total.
burr
New Member
Posts: 4
Joined: Thu 30 Aug, 2007 3:55 am

Post by burr »

Yes, I can see some optimizations. I would tell you where they are, but you didn't ask for that information. :P On a serious note, if you really want your program to be as optimized as possible, I would head on over to the #Optimize IRC channel hosted by UTI, and talk to Weregoose. He is quite good at helping people with TI-Basic (including optimizing, debugging, and general programming), and he is just generally a nice guy to talk to.
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

Post by patz2009 »

OK, smart-alec. What kind of optimizations do you have for this code?
User avatar
JoostinOnline
Regular Member
Posts: 133
Joined: Wed 11 Jul, 2007 10:42 pm
Location: Behind You

Post by JoostinOnline »

Change all the

Code: Select all

Repeat K
getkey->K
End
to

Code: Select all

Repeat Ans
getkey
End
Ans->K
You will lose a byte but it will be faster.
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

Post by patz2009 »

JoostinOnline, in this program the speed isn't as important, especially when it's waiting for a keypress. I would rather keep the byte savings and keep the keypresses how they are.

By the way, if there's code anywhere that someone doesn't understand, please ask :)
User avatar
JoostinOnline
Regular Member
Posts: 133
Joined: Wed 11 Jul, 2007 10:42 pm
Location: Behind You

Post by JoostinOnline »

Change

Code: Select all

Line(7C-6,68-7B,7C-6,63-7B
Line(7C-1,68-7B,7C-1,63-7B 
to

Code: Select all

For(Z,6,1,-5
Line(7C-Z,68-7B,7C-Z,63-7B
End
Do the same on below.
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Re: [TI-BASIC] Just making sure I didn't miss anything...

Post by kalan_vod »

[quote="patz2009"]

Code: Select all

:"Patz Calculator Sudoku V2
DelVar DDelVar HDelVar CgetKey ;not sure why you have this getKey
AxesOff
FnOff 
ZoomSto
0→Xmin
0→Ymin
94→Xmax ;1→(triangle)X
62→YMax ;1→(triangle)Y
Vertical 0
Horizontal 0
Vertical 94 ;Vertical Xmax, size over speed..1 byte less, but takes a little more time
Horizontal 62 ;Horizontal Ymax, same as above
Horizontal 10
Horizontal 54
randInt(E5,E6-1→P
Text(1,2,"PATZ CALCULATOR SUDOKU  V2
Text(11,9,"Start Game
Text(19,9,"Load Game
Text(27,9,"Difficulty: SIMPLE
Text(35,9,"Puzzle Number: ",P
Text(43,9,"Quit
Text(‾1,54,7,"Patrick Connor
Repeat K≤9
Text(8C+11,2,"{
Text(8C+11,5,">
Repeat K ;Repeat Ans, faster since you do not have to look into K each time as Ans is there and contains K
getKey→K
End
Text(‾1,8C+11,2,"  ;
C-(K=25)+(K=34→C ;could do C-(Ans=25)+(Ans=34:(Ans≠5)(Ans+5(Ans<0→C or combine both
(C≠5)(C+5(C<0→C
If max(K={21,105,22
Then
If K=22 or C=4 ;still working with C in Ans, so do Ans=4 instead
Goto Q ; I would suggest you restructure this code, as a memory leak will form when jumping outside a condition without ending it (doing the If ...:Then ...Goto 1 etc..)
If not(C ; same as above If not(Ans
1→K
If C=1
Then
85→dim(∟SUDO
; ∟SUDO, set in Ans..will save a few bytes and speed next line
If 462=Ans(1)+Ans(2)+Ans(3)+Ans(4
Then
Text(‾1,54,4,"   Load Game   
identity(9→[I]
For(A,1,9
For(B,1,9
∟SUDO(9A+B-5→[I](A,B
End
End
∟SUDO(2→H
∟SUDO(3→P
∟SUDO(4→D
2→K
Else
Text(‾1,54,4," Invalid save! 
End
DelVar ∟SUDO
End
If C=2
Then
Text(‾1,26,44,"     
(D≠4)(D+1→D
Text(27,44,sub("SIMPLE EASY   MEDIUM HARD   SUICIDE",7D+1,7 ;D is in Ans, would set 7Ans+1 instead...size is the same, but a little faster..
End
If C=3
Then
DelVar PText(‾1,34,63,"    
Repeat P>E5-1
Repeat Ans ;you do Repeat K up on top, but now you do as I suggested..stick to consistency ;)
getKey
End
Ans-91(Ans>91 and Ans<95)-78(Ans>81 and Ans<85)-65(Ans>71 and Ans<75)-102(Ans=102 ;you could get this smaller I will work later, and repost this line
If Ans<10 ;if they press something above key value 92 (0 key) you will have a problem, add a conditional If Ans>/=0 and Ans</=9 ;9, typing 10 cost another byte so it would work the same with doing </=9
10P+Ans→P
End
End
End
End
Text(‾1,54,4,"  Starting...  
P→rand
If K=1
6-D→H
[[1,7,8,3,4,2,6,5,9][4,9,3,5,1,6,7,8,2][5,6,2,9,7,8,4,1,3][9,5,4,7,3,1,2,6,8][8,1,7,6,2,9,5,3,4][3,2

,6,8,5,4,1,9,7][7,8,5,2,6,3,9,4,1][6,3,1,4,9,7,8,2,5][2,4,9,1,8,5,3,7,6→[J] ;not sure if the whole matrix is here, but that wouldn't matter for me :P
For(A,0,1
[J]T→[J]
For(B,0,2
For(C,0,7
rowSwap([J],randInt(1,3)+3B,3B+randInt(1,3→[J] ;never worked with sudokus, looks like a nice routine throughout.
End
End
End
If K=1
Then
[J]→[I]
For(A,1,26+8D ;not sure how this works, as you have A in each loop..
For(A,1,26+8D
randInt(1,9→B
randInt(1,9→C
If [I](B,C ;C is in Ans, could replace C with Ans
Then
0→[I](B,C
Else
A-1→A
End
End
End
End
ClrDraw
;place 66 in Ans, will save you a byte but cost a little speed (not much)..
Text(1,66,"PATZ ;in Ans contains 66, then you can replace 66 with Ans
Text(7,66,"CALC ;Same as above
Text(13,66,"SUDOKU ;Same as above
Text(3,86,"V2
For(A,0,3
Vertical 21A
Line(0,21A-1,62,21A-1 ;well you could place 21A in Ans or 21A-1..if the first you would replace Vertical 21A with Vertical Ans and 21A-1 in both cases with Ans-1...saves 4 bytes either way..Could replace 62 with Ymax, saves a byte but cost a little speed (it looks up Ymax, where 62 is already there).
End
For(B,1,9
For(C,1,9
If [I](B,C
Text(7B-6,7C-5,[I](B,C ;I would use the same vars for temp vars (like B and C in all my for loops etc..
End
End
1→B
1→C
Text(23,68,"Puzzle
Text(29,69,P
Text(38,70,H," hints
Text(44,73,"left.
While [J]≠[I] ;can change this..not sure atm, not by calc and I am tired >.>
Line(7C-6,68-7B,7C-6,63-7B
Line(7C-1,68-7B,7C-1,63-7B ;well, I would either place in a for loop like posted above
Repeat K ;Repeat Ans, as stated before
getKey→K
End
K-91(K>91 and K<95)-78(K>81 and K<85)-65(K>71 and K<75→K ;K is in Ans, replace K's with Ans for speed and as before..I will post some code later for a optimized version..
If K=22 ;K is in Ans, replace K with Ans
Goto Q
If K=34 or (K≥24 and K≤26 ; same as above about K
Then
Line(7C-6,68-7B,7C-6,63-7B,0 ;same as above about a For() loop.
Line(7C-1,68-7B,7C-1,63-7B,0 ;""
C+(K=26 and C<9)-(K=24 and C>1→C ;K is still in Ans, can replace..also you could do this above (about combining the two up ahead)..
B+(K=34 and B<9)-(K=25 and B>1→B
End
If K=21 and Hnot([I](B,C
Then
[J](B,C→K
H-1→H
Text(38,70,H ;H is in Ans, replace H with Ans
End
If K=23
Then
0→[I](B,C
Text(7B-6,7C-5,"    
End
If K<10 ;stated above about adding a conditional..
Then
K→[I](B,C
Text(7B-6,7C-5,K ;K is in Ans, replace
End
If K=31
Then
Text(57,70,"Saved!
{462-H-P-D,H,P,D→∟SUDO
For(A,1,9
For(K,1,9
[I](A,K→∟SUDO(9A+K-5
End
End
Text(‾1,55,70,"    
End
End
ClrHome
Disp "","Congratulations!","  You finished"," puzzle ","     on the","
Output(4,10,P
Output(6,5,sub(" SIMPLE   EASY   MEDIUM   HARD  SUICIDAL",8D+1,8
Pause "  difficulty!! ;I like to replace Pause with Repeat getKey:End, great pause but works with any key (some do not know that you need to press enter >.>)
Lbl Q
ZoomRcl
AxesOn
ClrHome
FnOn 
ClrDraw
DelVar [I]DelVar [J]Output(1,1,"
I would read through these tips, and rewrite the code to make it more efficient..or take the tips and work through them ;). Great code, very nice..Let me know if you need anymore help, as I may not have explained this very well (ran through this quickly). Good luck!
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

Post by patz2009 »

Ok, thanks for your feedback! There are a couple of quirks I feel I must share with you :) First off, I usually am untrusting of what is in Ans, and try to keep my usage of it to a minimum, as I don't trust of what it's going to contain. But, I will experiment some more :) Secondly, this code was made to only use a total of 7 reals, particularly A, B, C, D, H, K, and P. I like how I did that, though it might not be the best way to make this code. Now, for my responses...

Code: Select all

DelVar DDelVar HDelVar CgetKey ;not sure why you have this getKey
That geyKey is to fix a common MirageOS "bug", as getKey will always first return the key pressed in MirageOS to launch the program. That key would then get passed to the game's menu system, which is not good ;) Besides, it only adds a couple of bytes, and it fixes that problem.

Code: Select all

94→Xmax ;1→(triangle)X 
62→YMax ;1→(triangle)Y
Yeah, I learned about that trick soon after I posted the code. Will implement it soon. By the way, the triangle is called Delta :)

Code: Select all

Vertical 94 ;Vertical Xmax, size over speed..1 byte less, but takes a little more time
Xmax is not smaller than 94. Xmax is a two-byte token, where 9 and 4 are both one-byte tokens. And as you said, 94 is faster.

Code: Select all

Repeat K ;Repeat Ans, faster since you do not have to look into K each time as Ans is there and contains K
Sorry, in that position I can't do that as I will need K later on. The codes of line after that will quickly load C into Ans, destroying my K :(

Code: Select all

C-(K=25)+(K=34→C ;could do C-(Ans=25)+(Ans=34:(Ans≠5)(Ans+5(Ans<0→C or combine both
Yeah, in that one I'm sure Ans will contain C, so I'll fix that one.

Code: Select all

Text(27,44,sub("SIMPLE EASY   MEDIUM HARD   SUICIDE",7D+1,7 ;D is in Ans, would set 7Ans+1 instead...size is the same, but a little faster.
Also in this one I will change to Ans, as I'm sure it will contain D.

Code: Select all

If Ans<10 ;if they press something above key value 92 (0 key) you will have a problem, add a conditional If Ans>/=0 and Ans</=9 ;9, typing 10 cost another byte so it would work the same with doing </=9
As you have probably deducted, that formula is to set what ever the used pressed into Ans, if it was a number. If it's not, the key code will always be >10. I want this code to be able to pick up 0, and the mathematical part below makes sure that the number will never be less than 100000. By the way, the key code for 0 is 102, not 92. And, I don't see where the problem is, could you elaborate? I use this same code a few times in my program, and the -102(K=102 was added to support the 0 key.

Code: Select all

[[1,7,8,3,4,2,6,5,9][4,9,3,5,1,6,7,8,2][5,6,2,9,7,8,4,1,3][9,5,4,7,3,1,2,6,8][8,1,7,6,2,9,5,3,4]
[3,2,,6,8,5,4,1,9,7][7,8,5,2,6,3,9,4,1][6,3,1,4,9,7,8,2,5][2,4,9,1,8,5,3,7,6→[J] ;not sure if the whole matrix is here, but that wouldn't matter for me :P
The matrix is a working sudoku puzzle, which is later scrambled in the code. I don't use number substitution because that requires the use of at least 9 reals, which this whole code only uses 7.

Code: Select all

For(A,0,1 
[J]T→[J] 
For(B,0,2 
For(C,0,7 
rowSwap([J],randInt(1,3)+3B,3B+randInt(1,3→[J] ;never worked with sudokus, looks like a nice routine throughout. 
End 
End 
End
This is the code to scramble the sudoku puzzle, creating a genuinely random sudoku, unlike other programs which use number substitution and have a common puzzle layout. By the way, this code was based on an idea first put forth by HarrierFalcon, iirc.

Code: Select all

For(A,1,26+8D ;not sure how this works, as you have A in each loop..
Actually, it doesn't. It looks like SourceCoder added it in...?

Code: Select all

Text(7B-6,7C-5,[I](B,C ;I would use the same vars for temp vars (like B and C in all my for loops etc..
At this point in the code, B and C are used to store the cursor's current Row and Column, respectivly. I recycled B and C as I don't need their old values anymore. This goes along with my part about having only used 7 reals :)

Code: Select all

Line(7C-1,68-7B,7C-1,63-7B ;well, I would either place in a for loop like posted above
For( loops slow it down a ton. I hated the speed difference so much that I used two seperate Line( statements. The code size wasn't affected too much, anyway.


I hope that explains better what's going on in the code. I will learn to embrace Ans more thanks to your post, kalan_vod :)
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

Post by patz2009 »

Well, from all the general fixes that kalan_vod gave me, I was able to shave off about 100 bytes total and a general increase in speed. Seriously, if there's a part of ode you don't understand, please ask. I have a feeling the game saving/loading code can be optimized (anything with LSUDO is a game save routine)

Also, I have uploaded the 8XP if you want it. It is located here.

Here's the current code.

Code: Select all

::"Patz Calculator Sudoku V2
:DelVar DDelVar HDelVar CgetKey
:AxesOff
:FnOff 
:ZoomSto
:0→Xmin
:0→Ymin
:1→ΔX
:1→ΔY
:Vertical 0
:Horizontal 0
:Vertical 94
:Horizontal 62
:Horizontal 10
:Horizontal 54
:randInt(E5,E6-1→P
:Text(1,2,"PATZ CALCULATOR SUDOKU  V2
:Text(11,9,"Start Game
:Text(19,9,"Load Game
:Text(27,9,"Difficulty: SIMPLE
:Text(35,9,"Puzzle Number: ",P
:Text(43,9,"Quit
:Text(‾1,54,7,"Patrick Connor
:Repeat K≤9
:Text(8C+11,2,"{
:Text(8C+11,5,">
:Repeat K
:getKey→K
:End
:Text(‾1,8C+11,2," 
:C-(Ans=25)+(Ans=34→C
:(Ans≠5)(Ans+5(Ans<0→C
:If max(K={21,105,22
:Then
:If K=22 or Ans=4
:Goto Q
:If not(Ans
:1→K
:If C=1
:Then
:85→dim(∟SUDO
:∟SUDO
:If 462=Ans(1)+Ans(2)+Ans(3)+Ans(4
:Then
:Text(‾1,54,4,"   Load Game   
:identity(9→[I]
:For(A,1,9
:For(B,1,9
:∟SUDO(9A+B-5→[I](A,B
:End
:End
:∟SUDO(2→H
:∟SUDO(3→P
:∟SUDO(4→D
:2→K
:Else
:Text(‾1,54,4," Invalid save! 
:End
:DelVar ∟SUDO
:End
:If C=2
:Then
:Text(‾1,26,44,"     
:(D≠4)(D+1→D
:Text(27,44,sub("SIMPLE EASY   MEDIUM HARD   SUICIDE",7Ans+1,7
:End
:If C=3
:Then
:DelVar PText(‾1,34,63,"    
:Repeat P>E5-1
:Repeat Ans
:getKey→K
:End
:Ans-91(Ans>91 and Ans<95)-78(Ans>81 and Ans<85)-65(Ans>71 and Ans<75)-102(Ans=102
:If Ans≤9
:10P+Ans→P
:Text(35,64,P
:End
:End
:End
:End
:Text(‾1,54,4,"  Starting...  
:P→rand
:If K=1
:6-D→H
:[[1,7,8,3,4,2,6,5,9][4,9,3,5,1,6,7,8,2][5,6,2,9,7,8,4,1,3]
     [9,5,4,7,3,1,2,6,8][8,1,7,6,2,9,5,3,4][3,2,6,8,5,4,1,9,7]
     [7,8,5,2,6,3,9,4,1][6,3,1,4,9,7,8,2,5][2,4,9,1,8,5,3,7,6→[J]
:For(A,0,1
:[J]T→[J]
:For(B,0,2
:For(C,0,7
:rowSwap([J],randInt(1,3)+3B,3B+randInt(1,3→[J]
:End
:End
:End
:If K=1
:Then
:[J]→[I]
:For(A,1,26+8D
:randInt(1,9→B
:randInt(1,9→C
:If [I](B,C
:Then
:0→[I](B,C
:Else
:A-1→A
:End
:End
:End
:ClrDraw
:Text(1,66,"PATZ
:Text(7,66,"CALC
:Text(13,66,"SUDOKU
:Text(3,86,"V2
:For(A,0,3
:21A-1
:Vertical Ans+1
:Line(0,Ans,62,Ans
:End
:For(B,1,9
:For(C,1,9
:If [I](B,C
:Text(7B-6,7C-5,[I](B,C
:End
:End
:1→B
:1→C
:Text(23,68,"Puzzle
:Text(29,69,P
:Text(38,70,H," hints
:Text(44,73,"left.
:Repeat [J]=[I]
:Line(7C-6,68-7B,7C-6,63-7B
:Line(7C-1,68-7B,7C-1,63-7B
:Repeat K
:getKey→K
:End
:Ans-91(Ans>91 and Ans<95)-78(Ans>81 and Ans<85)-65(Ans>71 and Ans<75→Ans
:If Ans=22
:Goto Q
:If Ans=34 or (Ans≥24 and Ans≤26
:Then
:Line(7C-6,68-7B,7C-6,63-7B,0
:Line(7C-1,68-7B,7C-1,63-7B,0
:C+(Ans=26 and C<9)-(Ans=24 and C>1→C
:B+(K=34 and B<9)-(K=25 and B>1→B
:End
:If K=21 and Hnot([I](B,C
:Then
:[J](B,C→K
:H-1→H
:Text(38,70,Ans
:End
:If K=23
:Then
:0→[I](B,C
:Text(7B-6,7C-5,"    
:End
:If K≤9
:Then
:K→[I](B,C
:Text(7B-6,7C-5,Ans
:End
:If K=31
:Then
:Text(57,70,"Saved!
:{462-H-P-D,H,P,D→∟SUDO
:For(A,1,9
:For(K,1,9
:[I](A,K→∟SUDO(9A+K-5
:End
:End
:Text(‾1,55,70,"    
:End
:End
:ClrHome
:Disp "","Congratulations!","  You finished"," puzzle ","     on the","
:Output(4,10,P
:Output(6,5,sub(" SIMPLE   EASY   MEDIUM   HARD  SUICIDAL",8D+1,8
:Pause "  difficulty!!
:Lbl Q
:ZoomRcl
:AxesOn
:ClrHome
:FnOn 
:ClrDraw
:DelVar [I]DelVar [J]Output(1,1,"

Here's something extra for you, in case you want to know :P

Variable dictionary:

Code: Select all

A - Most used temporary variable
B - Multiple use variable
	Before gameplay, it is a general use FOR counter.
	During gameplay, it is used as the cursor's ROW
C - Multiple use variable
	(C)ommand chosen in Main Menu
	Temporary (c)ounter variable
	(C)olumn currently in use
D - Puzzle difficulty number (0=Simple ... 4=Suicidal)
H - Hints left (0-6)
K - Multiple use temporary variable
	In the main menu, if Start or Load game are selected, then this variable will become 1 or 2.
	It is generally used as a getKey storage in other cases.
	Also used in the Save Game feature
P - Puzzle number (100000-999999)
lSUDO - Save game file
	Elem.	Use
	1	Verify's save game validity. (see source code)
	2	Hints left
	3	Puzzle number
	4	Puzzle difficulty
	5-85	Puzzle layout
[J] - Completed puzzle
[I] - User's puzzle

Total number of variables used: 10
	7 Reals
	1 (optional) List
	2 Matrices
[/url]
burr
New Member
Posts: 4
Joined: Thu 30 Aug, 2007 3:55 am

Post by burr »

I have a few minutes of free time, so I figured I'd point out some more optimizations:

Code: Select all

:ZStandard
:84→Xmin
:52→Ymin
:ZInteger

Code: Select all

:C-(Ans=25)+(Ans=34

Code: Select all

:Ans-102(Ans=102)-13int(Ans/13(2>abs(5-abs(5-abs(Ans-83

Code: Select all

:rowSwap([J],1+int(3rand)+3B,3B+1+int(3rand→[J]

Code: Select all

:1+int(9rand→B
:1+int(9rand→C

Code: Select all

:Ans-13int(Ans/13(2>abs(5-abs(5-abs(Ans-83

Code: Select all

:If max(Ans={24,25,26,34

Code: Select all

:max(1,min(8,C+(Ans=26)-(Ans=24→C
:max(1,min(8,B+(K=34)-(K=25→B

Code: Select all

:{462-H-P-D,H,P,D→SUDO
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

Post by patz2009 »

Code: Select all

:ZStandard
:84→Xmin
:52→Ymin
:ZInteger
Implemented.

Code: Select all

:C-(Ans=25)+(Ans=34
Implemented.

Code: Select all

:Ans-102(Ans=102)-13int(Ans/13(2>abs(5-abs(5-abs(Ans-83

Code: Select all

:Ans-13int(Ans/13(2>abs(5-abs(5-abs(Ans-83
This doesn't seem to work right...?

Code: Select all

:rowSwap([J],1+int(3rand)+3B,3B+1+int(3rand→[J]

Code: Select all

:1+int(9rand→B
:1+int(9rand→C
1+int(9rand doesn't make any difference from randInt(1,9 and also seems to take more time, not to mention looking more messy. Not using.

Code: Select all

:If max(Ans={24,25,26,34
Implemented.

Code: Select all

:max(1,min(8,C+(Ans=26)-(Ans=24→C
:max(1,min(8,B+(K=34)-(K=25→B
Implemented after changing 8s to 9.

Code: Select all

:{462-H-P-D,H,P,D→SUDO
Implemented.


After fixing the code in the ways listed above, I have shaved off 13 bytes. Keep 'em coming! :)
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Besides rewriting it to be more efficient, there is no point to keep optimizing it...Rewrite without jumping out of Ifs and Thens (using Goto etc..)..
patz2009
New Member
Posts: 17
Joined: Wed 04 Apr, 2007 10:42 pm

Post by patz2009 »

kalan_vod, there is only one label in the code (Q) which is used to (q)uit the program. I use it to reset the users settings and clear out some vars. I don't see what is so bad about that one, as in many codes I see it written in some guides to even put labels in the start of programs.

If you have a better solution that is also speed/size friendly, please do share. It even hurt me to use Lbl/Goto that once, but I have taken the best care I could to keep it to a minimum. (only Goto'd twice in the whole code)

Besides, I see nothing wrong with the structure, it's just divided into 3 parts, mainly...
Post Reply