Maze

ClrText
" ":Green "       M a z e"
" ":Orange "    By: B. Conijn"
20->N
N->Dim List 1
N->Dim List 2
N->Dim List 3
N->Dim List 4
2->B
For 1->A To N
If Ran#<.6 And List 1[A]=0 And B<N
Then B->List 1[A]
A->List 3[B]
Isz B
IfEnd
If Ran#<.6 And List 2[A]=0 And B<N
Then B->List 2[A]
A->List 4[B]
Isz B
IfEnd
If Ran#<.6 And List 3[A]=0 And B<N
Then B->List 3[A]
A->List 1[B]
Isz B
IfEnd
If Ran#<.6 And List 4[A]=0 And B<N
Then B->List 4[A]
A->List 2[B]
Isz B
IfEnd
Next
B-1->B:1->A:0->E:1->F
ClrText
Green "       M a z e":" "
"         # #"
Orange "          tau"
"         # #":" "
Do
A=B=>0->F
If List 1[A]
Then Locate 10,4," "
Else Locate 10,4,"#"
IfEnd
If List 2[A]
Then Locate 11,3," "
Else Locate 11,3,"#"
IfEnd
If List 3[A]
Then Locate 12,4," "
Else Locate 12,4,"#"
IfEnd
If List 4[A]
Then Locate 11,5," "
Else Locate 11,5,"#"
IfEnd
0->D
While D=0 And F
Getkey->G
G=38 And List 1[A]=>List 1[A]->D
G=28 And List 2[A]=>List 2[A]->D
G=27 And List 3[A]=>List 3[A]->D
G=37 And List 4[A]=>List 4[A]->D
WhileEnd
D->A
Isz E
LpWhile F
Green "      Completed"