Close2
loclamorOn the 2008-11-02 at 03:34pm
Salut, je voufrais juste savoir si mon code peut être optimisé (je pense bien qu'il le peut smile ) et comment... tongue
je vous balance le code... :
If Ans=24 and X>1:Then
If [A](Y,X-1)=0:Then:X-1->X:Else
If [A](Y,X-1)!=1:Then
If [A](Y,X-1)=2 and ([A](Y,X-2)=0 or [A](Y,X-2)=3):Then:X-1->X
If [A](Y,X-1)=0:Then:2->[A](Y,X-1):Output(Y,X-1,"O":End
If [A](Y,X-1)=3:Then:0->[A](Y,X-1):Output(Y,X-1," ":End
End:End:End:End
If Ans=26 and X<16:Then
If [A](Y,X+1)=0:Then:X+1->X:Else
If [A](Y,X+1)!=1:Then
If [A](Y,X+1)=2 and ([A](Y,X+2)=0 or [A](Y,X+2)=3):Then:X+1->X
If [A](Y,X+1)=0:Then:2->[A](Y,X+1):Output(Y,X+1,"O":End
If [A](Y,X+1)=3:Then:0->[A](Y,X+1):Output(Y,X+1," ":End
End:End:End:End
If Ans=25 and Y>1:Then
If [A](Y-1,X)=0:Then:Y-1->Y:Else
If [A](Y-1,X)!=1:Then
If [A](Y-1,X)=2 and ([A](Y-2,X)=0 or [A](Y-2,X)=3):Then:Y-1->Y
If [A](Y-1,X)=0:Then:2->[A](Y-1,X):Output(Y-1,X,"O":End
If [A](Y-1,X)=3:Then:0->[A](Y-1,X):Output(Y-1,X," ":End
End:End:End:End
If Ans=34 and Y<8:Then
If [A](Y+1,X)=0:Then:Y+1->Y:Else
If [A](Y+1,X)!=1:Then
If [A](Y+1,X)=2 and ([A](Y+2,X)=0 or [A](Y+2,X)=3):Then:Y+1->Y
If [A](Y+1,X)=0:Then:2->[A](Y+1,X):Output(Y+1,X,"O":End
If [A](Y+1,X)=3:Then:0->[A](Y+1,X):Output(Y+1,X," ":End
End:End:End:End


voila. Et à la limite, les output on s'en fous smile vu que je vais me servir de ce code avce xLib, ils auront plus aucune utilité grin