; Mato v0.3  1995 by Janne Siren for Texas Intruments TI-85

Lbl EKA

ClLCD
Outpt(3,7,"Mato v0.3")
Outpt(5,2,"(C)1995 Janne Siren")
Outpt(7,4,"Paina nappulaa.")

0->G
While getKy==0
G+1->G
End

ClLCD

0->XK
0->YK
0->P
0->L
0->LE
0->OX
0->OY

0->xMin
64->xMax
0->yMin
32->yMax

{64,32}->dim V

Lbl ALKU

0->K
0->D

ClDrw

CoordOff
AxesOff
FnOff

L+1->L
L->LE

Outpt(1,1,"Hetki... Taso")
Outpt(1,15,L)

G+L->rand

Fill(0,V)

For(A,1,64,1)
1->V(A,32)
1->V(A,1)
End

For(A,1,32,1)
1->V(1,A)
1->V(64,A)
End

Line(0,0,64,0)
Line(64,0,64,32)
Line(64,32,0,32)
Line(0,32,0,0)

For(A,1,L,1)
int (rand*55)+5->XK
int (rand*25)+5->YK
PtOn(XK,YK)
If V(XK,YK)==2
Then
A-1->A
End
2->V(XK,YK)
End

3->XK
3->YK

While K!=22
getKy->K
If K==105
Then
While getKy==0
End
End
XK->OX
YK->OY
If K==24
Then
1->D
End
If K==26
Then
0->D
End
If K==25
Then
2->D
End
If K==34
Then
3->D
End
If D==0
Then
XK+1->XK
End
If D==1
Then
XK-1->XK
End
If D==2
Then
YK+1->YK
End
If D==3
Then
YK-1->YK
End
Line(XK,YK,OX,OY)
If V(XK,YK)==1
Then
22->K
End
If V(XK,YK)==2
Then
P+100->P
LE-1->LE
2->V(XK,YK)
If LE==0
Then
22->K
End
End
1->V(XK,YK)
End

ClLCD

If LE==0
Then
Goto ALKU
End

Outpt(1,1,"Taso:  Pisteet:")
Outpt(3,1,L)
Outpt(3,8,P)

Outpt(5,1,"<EXIT> = lopeta.")
Outpt(7,1,"<ENTER> = uusi peli.")

0->K

While K!=22 and K!=105
getKy->K
End

If K!=22
Then
Goto EKA
End

0->V
CoordsOn
AxesOn
FnOn

-10->xMin
10->xMax
-10->yMin
10->yMax

ClLCD
