Site hosted by Angelfire.com: Build your free website today!

SQUARE

(Back)
Email the author:Ian Kammann


I don't have a comment on this one yet. Sorry if you tried this program out prior to this little message going up, untill now, it was not whole. I messed up in my html code. OOPS! I forgot to use the html code for < and >.

ClrT
Print "TO WIN THIS GAME
Print "YOU MUST MARK
Print "OUT THE CORNERS 
Print "OF A SQUARE.
Print " 
Print "THE X AND Y
Print "COORDINATES
Print "RANGE FROM 1 - 4
Wait 15
ClrT
Print "YOU GO FIRST.
Wait 3
{3,18}@sto@dim(mat A)
fill(0,mat A)
..2@sto@mat A(2,18)
1@sto@G
0@sto@U
0@sto@P
1@sto@Q
1@sto@V
..5@sto@Xmin
8.65@sto@Xmax
10@sto@Xscl
..5@sto@Ymin
4.5625@sto@Ymax
10@sto@Yscl
Line(.5,.5,.5,4.5)
Line(.5,.5,4.5,.5)
Line(4.55,.5,4.55,4.5)
Line(4.5,4.5,.5,4.5)
Line(.7,.7,4.3,.7)
Line(4.35,.7,4.35,4.3)
Line(4.3,4.3,.7,4.3)
Line(.7,4.3,.7,.7)
Label S1
1@sto@W
Label S2
PntON(V,W)
W+1@sto@W
If W@<=@4Goto S2
V+1@sto@V
If V@<=@4Goto S1
Wait 5

Label PLOT1
If P=1Goto E1
1@sto@R
1@sto@G
1@sto@B
0@sto@Z
ClrT
@-@@pi@@sto@X
Print "ENTER YOUR
Print "COORDINATES
Print " 
Input X
If X@not_=@@-@@pi@Goto Y
DispG
Wait 
Goto PLOT1
Label Y
Input Y
If X=1Goto OK
If X=2Goto OK
If X=3Goto OK
If X=4Goto OK
Goto TRY

Label OK
If Y=1Goto OK1
If Y=2Goto OK1
If Y=3Goto OK1
If Y=4Goto OK1
Goto TRY

Label OK1
If R>PGoto DATA
If X=mat A(1,R)Goto OK2
R+1@sto@R
Goto OK1

Label OK2
If Y=mat A(2,R)Goto TRY
R+1@sto@R
Goto OK1

Label TRY
Print "TRY AGAIN
Wait 3
DispG
Wait 5
If Z=0Goto PLOT1
Goto PLOT2
Label DATA
X@sto@mat A(1,P+1)
Y@sto@mat A(2,P+1)
Line(X-.2,Y,X+.21,Y)
Line(X,Y-.2,X,Y+.2)
Label Q1
P+1@sto@P
If P<7Goto PLOT2

Label CHECK
G@sto@A
1@sto@Q
mat A(1,P)@sto@C
mat A(2,P)@sto@D
Label CHECK2
mat A(1,A)@sto@E
mat A(2,A)@sto@F
If Q>1Goto SKIP
(C-E)@^2@+(D-F)@^2@@sto@mat A(2,18)
C@sto@mat A(1,17)
F@sto@mat A(2,17)
D@sto@mat A(3,17)
E@sto@mat A(1,18)
Goto C1R
Label SKIP
(C-E)@^2@+(D-F)@^2@@sto@L
If L=mat A(2,18)Goto THIRD
Label C1R
Q+1@sto@Q
A+2@sto@A
If A<PGoto CHECK2
1@sto@Q
G+2@sto@G
If G@<=@PGoto CHECK
Goto PLOT2

Label THIRD
@-@C+mat A(1,18)+E@sto@M
@-@D+mat A(2,17)+F@sto@N
Z-1@sto@O
Label THIRD1
O+2@sto@O
If O>PGoto C1R
If M=mat A(1,O)Goto THIRD2
Goto THIRD1

Label THIRD2
If N=mat A(2,O)Goto END
Goto THIRD1

Label END
If L@not_=@((M-C)@^2@+(N-D)@^2@)/2Goto THIRD1
Line(M,N,mat A(1,18),mat A(2,17))
Line(mat A(1,18),mat A(2,17),C,D)
Line(C,D,E,F)
Line(E,F,M,N)
ClrT
I@sto@U

Label F
DispT
Wait 1
DispG
Wait 1
U+1@sto@U
If U<4Goto F

Label E1
End

Label PLOT2
0@sto@T
1@sto@R
2@sto@B
0@sto@Z
Label CA
If P>4Goto CB0
ipart (random *1.9)+2@sto@X
ipart (random *1.9)+2@sto@Y
Label CAR
If R>PGoto CZ
If X=mat A(1,R)Goto CAY
R+1@sto@R
Goto CAR
Label CAY
If Y=mat A(2,R)Goto PLOT2
R+1@sto@R
Goto CAR

Label CB0
1@sto@T
0@sto@N
2@sto@S
0@sto@Z
P-1@sto@B
1@sto@Q
1@sto@R
2@sto@A
Label CF1
mat A(1,B)@sto@C
mat A(2,B)@sto@D
Label CB1
mat A(1,A)@sto@E
mat A(2,A)@sto@F
If Q>1Goto CCB
(C-E)@^2@+(D-F)@^2@@sto@mat A(2,18)
C@sto@mat A(1,17)
F@sto@mat A(2,17)
D@sto@mat A(3,17)
E@sto@mat A(1,18)
Goto CB2
Label CCB
(C-E)@^2@+(D-F)@^2@@sto@L
If L=mat A(2,18)Goto CB3
Label CB2
Q+1@sto@Q
If N=1Goto AP
A+2@sto@A
If A@<=@PGoto CB1
S+2@sto@S
S@sto@A
1@sto@Q
If A@<=@PGoto CB1
0@sto@Q
2@sto@B
P+1@sto@A
1@sto@N
Label AP
Q+1@sto@Q
A-2@sto@A
If A>0Goto CF1
P-1@sto@A
1@sto@Q
B+2@sto@B
If B@<=@PGoto CF1
Goto CD0

Label CB3
@-@C+mat A(1,18)+E@sto@X
@-@D+mat A(2,17)+F@sto@Y
If abs(2.5-X)>1.5Goto CB2
If abs(2.5-Y)>1.5Goto CB2
If L@not_=@((X-C)@^2@+(Y-D)@^2@)/2Goto CB2
0@sto@O
Label CB4
O+1@sto@O
If O>PGoto CZ
If X@not_=@mat A(1,O)Goto CB4
If Y=mat A(2,O)Goto CB2
Goto CB4

Label CD0
0@sto@T
P@sto@B
0@sto@N
1@sto@S
S@sto@A
1@sto@Q
Label CDF1
mat A(1,B)@sto@C
mat A(2,B)@sto@D
Label CD1
mat A(1,A)@sto@E
mat A(2,A)@sto@F
If Q>1Goto CCD
(C-E)@^2@+(D-F)@^2@@sto@mat A(2,18)
C@sto@mat A(1,17)
F@sto@mat A(2,17)
D@sto@mat A(3,17)
E@sto@mat A(1,18)
Goto CD2
Label CCD
(C-E)@^2@+(D-F)@^2@@sto@L
If L=0Goto CD2
If L=mat A(2,18)Goto CD3
Label CD2
Q+1@sto@Q
If N=1Goto ADP
A+2@sto@A
If A@<=@PGoto CD1
S+2@sto@S
S@sto@A
1@sto@Q
If A@<=@PGoto CD1
0@sto@Q
1@sto@B
P+2@sto@A
1@sto@N
Label ADP
Q+1@sto@Q
A-2@sto@A
If A>0Goto CDF1
P@sto@A
1@sto@Q
B+2@sto@B
If B@<=@PGoto CDF1
Goto CY

Label CD3
@-@C+mat A(1,18)+E@sto@X
@-@D+mat A(2,17)+F@sto@Y
If abs(2.5-X)>1.5Goto CD2
If abs(2.5-Y)>1.5Goto CD2
If L@not_=@((X-C)@^2@+(Y-D)@^2@)/2Goto CD2
0@sto@O
Label CD4
O+1@sto@O
If O>PGoto CZ
If X@not_=@mat A(1,O)Goto CD4
If Y=mat A(2,O)Goto CD2
Goto CD4

Label CY
1@sto@R
1@sto@B
1@sto@Z
ipart (random *3.9)+1@sto@X
ipart (random *3.9)+1@sto@Y
Label CX2
If R>PGoto CZ
If X=mat A(1,R)Goto CX3
R+1@sto@R
Goto CX2
Label CX3
If Y=mat A(2,R)Goto CY
R+1@sto@R
Goto CX2

Label CZ
X@sto@mat A(1,P+1)
Y@sto@mat A(2,P+1)
Line(X-.2,Y-.2,X+.2,Y+.2)
Line(X-.2,Y+.2,X+.2,Y-.2)
If P@>=@7Goto Q2
Wait 10

Label Q2
P+1@sto@P
2@sto@B
I@sto@Q
I@sto@Z
If T=1Goto ED
Goto PLOT1
Label ED
Line(X,Y,mat A(1,18),mat A(2,17))
Line(mat A(1,18),mat A(2,17),C,D)
Line(C,D,E,F)
Line(E,F,X,Y)
ClrT
I@sto@U
Goto F