1

Salut!
Je suis entrein de faire un morpion, mais j'ai quelques petit problémes:

Code:

ClrHome
ClrDraw
0->Z
0->Y
0->X
0->W
0->V
0->U
0->T
0->S
0->R
Line(32,0,32,62)
Line(62,0,62,62)
Line(0,21,94,21)
Line(0,42,94,42)
Lbl 1
randInt(1,9->C
If (C=1)(Z<1)
Then
Circle(15,52,5
1->Z
Else
Goto 1
End
If (C=2)(Y<1)
Then
Circle(45,52,5
1->Y
Else
Goto 1
End
If (C=3)(X<1)
Then
Circle(79,52,5
1->X
Else
Goto 1
End
If (C=4)(W<1)
Then
Circle(15,32,5
1->W
Else
Goto 1
End
If (C=5)(V<1)
Then
Circle(45,32,5
1->V
Else
Goto 1
End
If (C=6)(U<1)
Then
Circle(79,32,5
1->U
Else
Goto 1
End
If (C=7)(T<1)
Then
Circle(15,10,5
1->T
Else
Goto 1
End
If (C=8)(S<1)
Then
Circle(45,10,5
1->S
Else
Goto 1
End
If (C=9)(R<1)
Then
Circle(79,10,5
1->R
Else
Goto 1
End
Repeat K
getKey->K
If K=72 and Z<1
Then
Line(9,49,16,56
Line(16,49,9,56
2->Z
End
If K=73 and Y<1
Then
Line(42,49,49,56
Line(49,49,42,56
2->Y
End
If K=74 and X<1
Then
Line(74,49,81,56
Line(81,49,74,56
2->X
End
If K=82 and W<1
Then
Line(9,28,16,35
Line(16,28,9,35
2->W
End
If K=83 and V<1
Then
Line(42,28,49,35
Line(49,28,42,35
2->V
End
If K=84 and U<1
Then
Line(74,28,81,35
Line(81,28,74,35
2->U
End
If K=92 and T<1
Then
Line(9,5,16,12
Line(16,5,9,12
2->T
End
If K=93 and S<1
Then
Line(42,5,49,12
Line(49,5,42,12
2->S
End
If K=94 and R<1
Then
Line(81,5,74,12
Line(74,5,81,12
2->R
End
End
Goto 1


Le prob, c'est que en appuiyant sur une des touches, aucunne croix n'apparait.
Y'a seulement un cercle dans la premiére case en haut à gauche et puis c'est tout.
Vous pouvez m'aider plz?

2

Je vais tester ça et j'éditerai le post si je trouve d'où ça viens. Mais déjà : 'If (C=5)(V<1)' ça me parai bizarre, je penserai plutot pour : 'If C=5 and V<1'...

edit 1: Déjà t'aurai pu utiliser une matrice aulieu de 9 variables... (mais bon c'est pas ça qui fait tout bugger...) Ensuite, tu peut utiliser zTXT pour recopier ton code (ça t'évitera de remplacer la flèche par '->').

edit2: Bon voilà, j'ai modifier pleins de trucs pour que ça marche (mais c'est simple à comprendre), et j'ai transformer tes variables en une matrice (bien plus pratique pour tester les conditions pour gagner...) :
ClrHome:ClrDraw:AxesOff:GridOff
0→Xmin:0→Ymin:94→Xmax:62→Ymax
DelVar [A]
{3,3→dim([A]
Line(32,0,32,62)
Line(62,0,62,62)
Line(0,21,94,21)
Line(0,42,94,42)
While 1
Lbl 1
randInt(1,9→A
If A=1:Then
If [A](1,1)≠1:Then
If [A](1,1)≠2:Then:Circle(15,52,5
1→[A](1,1):Else:Goto 1:End:End:End
If A=2:Then
If [A](1,2)≠1:Then
If [A](1,2)≠2:Then:Circle(45,52,5
1→[A](1,2):Else:Goto 1:End:End:End
If A=3:Then
If [A](1,3)≠1:Then
If [A](1,3)≠2:Then:Circle(79,52,5
1→[A](1,3):Else:Goto 1:End:End:End
If A=4:Then
If [A](2,1)≠1:Then
If [A](2,1)≠2:Then:Circle(15,32,5
1→[A](2,1):Else:Goto 1:End:End:End
If A=5:Then
If [A](2,2)≠1:Then
If [A](2,2)≠2:Then:Circle(45,32,5
1→[A](2,2):Else:Goto 1:End:End:End
If A=6:Then
If [A](2,3)≠1:Then
If [A](2,3)≠2:Then:Circle(79,32,5
1→[A](2,3):Else:Goto 1:End:End:End
If A=7:Then
If [A](3,1)≠1:Then
If [A](3,1)≠2:Then:Circle(15,10,5
1→[A](3,1):Else:Goto 1:End:End:End
If A=8:Then
If [A](3,2)≠1:Then
If [A](3,2)≠2:Then:Circle(45,10,5
1→[A](3,2):Else:Goto 1:End:End:End
If A=9:Then
If [A](3,3)≠1:Then
If [A](3,3)≠2:Then:Circle(79,10,5
1→[A](3,3):Else:Goto 1:End:End:End
Lbl 2
Repeat K
getKey→K
End
If K=72:Then
If [A](1,1)≠1:Then
If [A](1,1)≠2:Then:Line(9,49,16,56
Line(16,49,9,56:2→[A](1,1):End:Else:Goto 2:End:End
If K=73:Then
If [A](1,2)≠1:Then
If [A](1,2)≠2:Then:Line(42,49,49,56
Line(49,49,42,56:2→[A](1,2):End:Else:Goto 2:End:End
If K=74:Then
If [A](1,3)≠1:Then
If [A](1,3)≠2:Then:Line(74,49,81,56
Line(81,49,74,56:2→[A](1,3):End:Else:Goto 2:End:End
If K=82:Then
If [A](2,1)≠1:Then
If [A](2,1)≠2:Then:Line(9,28,16,35
Line(16,28,9,35:2→[A](2,1):End:Else:Goto 2:End:End
If K=83:Then
If [A](2,2)≠1:Then
If [A](2,2)≠2:Then:Line(42,28,49,35
Line(49,28,42,35:2→[A](2,2):End:Else:Goto 2:End:End
If K=84:Then
If [A](2,3)≠1:Then
If [A](2,3)≠2:Then:Line(74,28,81,35
Line(81,28,74,35:2→[A](2,3):End:Else:Goto 2:End:End
If K=92:Then
If [A](3,1)≠1:Then
If [A](3,1)≠2:Then:Line(9,5,16,12
Line(16,5,9,12:2→[A](3,1):End:Else:Goto 2:End:End
If K=93:Then
If [A](3,2)≠1:Then
If [A](3,2)≠2:Then:Line(42,5,49,12
Line(49,5,42,12:2→[A](3,2):End:Else:Goto 2:End:End
If K=94:Then
If [A](3,3)≠1:Then
If [A](3,3)≠2:Then:Line(81,5,74,12
Line(74,5,81,12:2→[A](3,3):End:Else:Goto 2:End:End End


Il reste juste un bug : il ne faut choisir un endroit que "l'ordi" a déjà choisit (je fixerai ça plus tard si tu trouve pas...).

3

Merci, en fet le truk c'est que je ne savais pas me servir des matrices. Donc je vé bidouiller çà. smile