Ce memory marche en solo ou 2 joueurs (pas de cpu).
[I] est une matrice.
Vous pouvez trafiquer les dimensions en éditant (mais attention au manque de caractères du jeu). Elles ne doivent pas dépasser l'écran (8*16)
Code
Normal
Flottant
EffEcr
entAléat(1,2)->¤
2->M
Menu("mode","solo",M1,"2joueurs",M2
Lbl M1
1->M
0->¤
Lbl M2
6->G
6->H
Menu("dimension","4*4",4,"4*7",5,"6*6",6
Lbl 4
4->G
4->H
goto 6
Lbl 5
4->G
7->H
Lbl6
{1,1}->dim([I])
0->[I](1,1)
{G,H}->dim([I])
1->X
1->Y
EffListe L1
G*H/2->dim(L1)
1->dim(L2)
For(S,1,G
For(T,1,H
Lbl 0
output(8,8,S)
entaleat(1,G*H/2)->Z
If L1(Z)=2
goto 0
L1(Z)+1->L1(Z)
Z->[I](T,S)
End
End
For(V,1,G
For(W,1,H
output(V,W,"?
End
End
output(1,1,"X
If M=2
Then
0->L3(1)
0->L3(2)
output(8,15,"J
EffListe L1
2->dim(L1)
End
0->A
0->B
0->L1(1)
0->L2(1)
0->B
G*H->Z
Lbl 1
If M=2
output(8,16,¤
0->K
X->S
Y->T
repeat K[=/=]0
codetouche->K
If K=82 et X[=/=]1
X-1->X
If K=84 et X[=/=]H
X+1->X
If K=73 et Y[=/=]1
Y-1->Y
If K=93 et Y[=/=]G
Y+1->Y
[I](Y,X)->I
If K=83 et (I=0 ou X=L2(1) et Y=L1(1))
0->K
If K=83 et I[=/=]0
Then
A+1->A
X->L2(A)
Y->L1(A)
End
End
[I](T,S)->J
If K=83 ou X=L2(1) et Y=L1(1)
Then
X->N
Y->O
Else
S->N
T->O
End
If J[=/=]0 ou S=L2(1) et T=L1(1)
output(T,S,"?
If J=0
output(T,S," "
output(Y,X,"X
[I](O,N)->P
If K=83 ou S=L2(1) et T=L1(1) ou X=L2(1) et Y=L1(1)
Then
If P<10
output(O,N,P
If P=11
output(O,N,"¤
If P=12
output(O,N,"A
If P=13
output(O,N,"B
If P=14
output(O,N,"C
If P=15
output(O,N,"D
If P=16
output(O,N,"E
If P=17
output(O,N,"F
If P=18
output(O,N,"G
...
End
If A=2
Then
0->K
repeat K=83
codetouche->K
End
If [I](L1(1),L2(1))=[I](Y,X)
Then
0->[I](L1(1),L2(1))
0->[I](Y,X)
output(L1(1),L2(1)," "
output(Y,X,"X
Z-2->Z
If M=2
L3(¤)+1->L3(¤)
Else
output(L1(1),L2(1),"?
output(Y,X,"X
End
0->A
3-¤->¤
0->L1(1)
0->L2(1)
If M=1
¤+1->¤
End
If Z[=/=]0
goto 1
EffEcr
If M=1
Then
Disp "coups",¤
Else
Disp "J1:","J2:"
output(1,5,L3(1)
output(2,5,L3(2)
End