```
Lbl 2
ClrHome
DelVar [A]{10,16→dim([A] // [A] represents the map, 1 is a wall, 0 is a free space
11→X:2→Y:10→I:9→J //X and Y are the coordinates of player 1, I and J of the player 2
For(A,1,10 //I put walls on the sides of the map
1→[A](A,1
1→[A](A,16
End
For(A,2,15
1→[A](1,A
1→[A](10,A
End
For(A,1,6
Output(A,1,sub("Joueur",A,1
End
Output(Y-1,X-1,"O //i display the position of players O=player 1 and θ=player 2
Output(J-1,I-1,"θ // the -1 is because there is a space between the screen and the matrix, to hide the sides of the map
1→[A](2,11 //put the positions of players in the matrix
1→[A](9,10
While 1
X→M:Y→L //to test if the player moved
Repeat X≠M or Y≠L
Output(8,1,"1 //for player 1
Repeat max(Ans={24,25,26,34 //asking for move
getKey-> K
End
Output(Y-1,X-1,"X //X is a wall on the screen
X+(K=26 and 0=[A](Y,X+1))-(K=24 and 0=[A](Y,X-1→X //moves of the players
Y-(K=25 and 0=[A](Y-1,X))+(K=34 and 0=[A](Y+1,X→Y
Output(Y-1,X-1,"O
1→[A](Y,X
End
If min(seq([A](J+A,I),A,⁻1,1,2)) and min(seq([A](J,I+A),A,⁻1,1,2:Goto 1 //test if the other player can move
//memory leaks but it happens only one time at each game
I→M:J→L //same thing for player 2
Repeat I≠M or J≠L
Output(8,1,"2
Repeat max(Ans={24,25,26,34
getKey-> K
End
Output(J-1,I-1,"X
I+(K=26 and 0=[A](J,I+1))-(K=24 and 0=[A](J,I-1→I
J-(K=25 and 0=[A](J-1,I))+(K=34 and 0=[A](J+1,I→J
Output(J-1,I-1,"θ
1→[A](J,I
End
If min(seq([A](Y+A,X),A,⁻1,1,2)) and min(seq([A](Y,X+A),A,⁻1,1,2:Goto 1
End
Lbl 1
For(A,1,3
Output(A+3,2,sub("Win",A,1
End
Pause
Goto 2
```

I changed also that :

```
(K=26)(0=[A](Y,X+1))
become
(K=26 and 0=[A](J,I+1))
```