Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testgagner
- dim choixcase as byte //laquelle des deux cases dois-je choisir... à utiliser dans la préparation d'une éventuelle victoire
- choixcase=floor(rnd*2)+1
- //est-ce qu'on peut gagner le prochain tour?
- if m1=2 and m2=2 and m3=0 then
- m3=2
- c3.backdrop=opic
- elseif m4=2 and m5=2 and m6=0 then
- m6=2
- c6.backdrop=opic
- elseif m7=2 and m8=2 and m9=0 then
- m9=2
- c9.backdrop=opic
- elseif m1=2 and m2=0 and m3=2 then
- m2=2
- c2.backdrop=opic
- elseif m4=2 and m5=0 and m6=2 then
- m5=2
- c5.backdrop=opic
- elseif m7=2 and m8=0 and m9=2 then
- m8=2
- c8.backdrop=opic
- elseif m1=0 and m2=2 and m3=2 then
- m1=2
- c1.backdrop=opic
- elseif m4=0 and m5=2 and m6=2 then
- m4=2
- c4.backdrop=opic
- elseif m7=0 and m8=2 and m9=2 then
- m7=2
- c7.backdrop=opic
- elseif m1=2 and m4=2 and m7=0 then
- m7=2
- c7.backdrop=opic
- elseif m2=2 and m5=2 and m8=0 then
- m8=2
- c8.backdrop=opic
- elseif m3=2 and m6=2 and m9=0 then
- m9=2
- c9.backdrop=opic
- elseif m1=2 and m4=0 and m7=2 then
- m4=2
- c4.backdrop=opic
- elseif m2=2 and m5=0 and m8=2 then
- m5=2
- c5.backdrop=opic
- elseif m3=2 and m6=0 and m9=2 then
- m6=2
- c6.backdrop=opic
- elseif m1=0 and m4=2 and m7=2 then
- m1=2
- c1.backdrop=opic
- elseif m2=0 and m5=2 and m8=2 then
- m2=2
- c2.backdrop=opic
- elseif m3=0 and m6=2 and m9=2 then
- m3=2
- c3.backdrop=opic
- elseif m1=0 and m5=2 and m9=2 then
- m1=2
- c1.backdrop=opic
- elseif m1=2 and m5=0 and m9=2 then
- m5=2
- c5.backdrop=opic
- elseif m1=2 and m5=2 and m9=0 then
- m9=2
- c9.backdrop=opic
- elseif m3=0 and m5=2 and m7=2 then
- m3=2
- c3.backdrop=opic
- elseif m3=2 and m5=0 and m7=2 then
- m5=2
- c5.backdrop=opic
- elseif m3=2 and m5=2 and m7=0 then
- m7=2
- c7.backdrop=opic
- //si le joueur a 2 X de suite... je dois l'arrêter!
- elseif m1=1 and m2=1 and m3=0 then
- m3=2
- c3.backdrop=opic
- elseif m4=1 and m5=1 and m6=0 then
- m6=2
- c6.backdrop=opic
- elseif m7=1 and m8=1 and m9=0 then
- m9=2
- c9.backdrop=opic
- elseif m1=1 and m2=0 and m3=1 then
- m2=2
- c2.backdrop=opic
- elseif m4=1 and m5=0 and m6=1 then
- m5=2
- c5.backdrop=opic
- elseif m7=1 and m8=0 and m9=1 then
- m8=2
- c8.backdrop=opic
- elseif m1=0 and m2=1 and m3=1 then
- m1=2
- c1.backdrop=opic
- elseif m4=0 and m5=1 and m6=1 then
- m4=2
- c4.backdrop=opic
- elseif m7=0 and m8=1 and m9=1 then
- m7=2
- c7.backdrop=opic
- elseif m1=1 and m4=1 and m7=0 then
- m7=2
- c7.backdrop=opic
- elseif m2=1 and m5=1 and m8=0 then
- m8=2
- c8.backdrop=opic
- elseif m3=1 and m6=1 and m9=0 then
- m9=2
- c9.backdrop=opic
- elseif m1=1 and m4=0 and m7=1 then
- m4=2
- c4.backdrop=opic
- elseif m2=1 and m5=0 and m8=1 then
- m5=2
- c5.backdrop=opic
- elseif m3=1 and m6=0 and m9=1 then
- m6=2
- c6.backdrop=opic
- elseif m1=0 and m4=1 and m7=1 then
- m1=2
- c1.backdrop=opic
- elseif m2=0 and m5=1 and m8=1 then
- m2=2
- c2.backdrop=opic
- elseif m3=0 and m6=1 and m9=1 then
- m3=2
- c3.backdrop=opic
- elseif m1=0 and m5=1 and m9=1 then
- m1=2
- c1.backdrop=opic
- elseif m1=1 and m5=0 and m9=1 then
- m5=2
- c5.backdrop=opic
- elseif m1=1 and m5=1 and m9=0 then
- m9=2
- c9.backdrop=opic
- elseif m3=0 and m5=1 and m7=1 then
- m3=2
- c3.backdrop=opic
- elseif m3=1 and m5=0 and m7=1 then
- m5=2
- c5.backdrop=opic
- elseif m3=1 and m5=1 and m7=0 then
- m7=2
- c7.backdrop=opic
- elseif nbcoups=1 then //deuxième tour
- dim coupii as byte //variable qui détermine dans quelle case il faut jouer au 2e coup
- coupii=floor(rnd*4)+1
- if m5=1 then
- select case coupii
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m3=2
- c3.backdrop=opic
- case 3
- m7=2
- c7.backdrop=opic
- case 4
- m9=2
- c9.backdrop=opic
- end select
- elseif m1=1 or m3=1 or m7=1 or m9=1 then
- m5=2
- c5.backdrop=opic
- elseif m2=1 then
- select case coupii
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m3=2
- c3.backdrop=opic
- case 3
- m5=2
- c5.backdrop=opic
- case 4
- m8=2
- c8.backdrop=opic
- end select
- elseif m4=1 then
- select case coupii
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- case 3
- m6=2
- c6.backdrop=opic
- case 4
- m7=2
- c7.backdrop=opic
- end select
- elseif m6=1 then
- select case coupii
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m4=2
- c4.backdrop=opic
- case 3
- m5=2
- c5.backdrop=opic
- case 4
- m9=2
- c9.backdrop=opic
- end select
- elseif m8=1 then
- select case coupii
- case 1
- m2=2
- c2.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- case 3
- m7=2
- c7.backdrop=opic
- case 4
- m9=2
- c9.backdrop=opic
- end select
- end if
- //préparation d'une éventuelle victoire
- elseif m1=2 and m2=0 and m3=0 then
- if m8=1 then
- m2=2
- c2.backdrop=opic
- elseif m6=1 or m7=1 or m9=1 then
- m3=2
- c3.backdrop=opic
- else
- select case choixcase
- case 1
- m2=2
- c2.backdrop=opic
- case 2
- m3=2
- c3.backdrop=opic
- end select
- end if
- elseif m4=2 and m5=0 and m6=0 then
- m5=2
- c5.backdrop=opic
- elseif m7=2 and m8=0 and m9=0 then
- if m2=1 then
- m8=2
- c8.backdrop=opic
- elseif m1=1 or m3=1 or m6=1 then
- m9=2
- c9.backdrop=opic
- else
- select case choixcase
- case 1
- m8=2
- c8.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- end if
- elseif m1=0 and m2=2 and m3=0 then
- if m4=1 then
- m1=2
- c1.backdrop=opic
- elseif m6=1 then
- m3=2
- c3.backdrop=opic
- else
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m3=2
- c3.backdrop=opic
- end select
- end if
- elseif m4=0 and m5=2 and m6=0 then
- if m1=1 or m7=1 then
- m4=2
- c4.backdrop=opic
- elseif m3=1 or m9=1 then
- m6=2
- c6.backdrop=opic
- else
- select case choixcase
- case 1
- m4=2
- c4.backdrop=opic
- case 2
- m6=2
- c6.backdrop=opic
- end select
- end if
- elseif m7=0 and m8=2 and m9=0 then
- if m4=1 then
- m7=2
- c7.backdrop=opic
- elseif m6=1 then
- m9=2
- c9.backdrop=opic
- else
- select case choixcase
- case 1
- m7=2
- c7.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- end if
- elseif m1=0 and m2=0 and m3=2 then
- if m4=1 or m7=1 or m9=1 then
- m1=2
- c1.backdrop=opic
- elseif m8=1 then
- m2=2
- c2.backdrop=opic
- else
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m2=2
- c2.backdrop=opic
- end select
- end if
- elseif m4=0 and m5=0 and m6=2 then
- m5=2
- c5.backdrop=opic
- elseif m7=0 and m8=0 and m9=2 then
- if m4=1 or m1=1 or m3=1 then
- m7=2
- c7.backdrop=opic
- elseif m2=1 then
- m8=2
- c8.backdrop=opic
- else
- select case choixcase
- case 1
- m7=2
- c7.backdrop=opic
- case 2
- m8=2
- c8.backdrop=opic
- end select
- end if
- elseif m1=2 and m4=0 and m7=0 then
- if m8=1 or m9=1 or m3=1 then
- m7=2
- c7.backdrop=opic
- elseif m6=1 then
- m4=2
- c4.backdrop=opic
- else
- select case choixcase
- case 1
- m4=2
- c4.backdrop=opic
- case 2
- m7=2
- c7.backdrop=opic
- end select
- end if
- elseif m2=2 and m5=0 and m8=0 then
- m5=2
- c5.backdrop=opic
- elseif m3=2 and m6=0 and m9=0 then
- if m8=1 or m7=1 or m1=1 then
- m9=2
- c9.backdrop=opic
- elseif m4=1 then
- m6=2
- c6.backdrop=opic
- else
- select case choixcase
- case 1
- m6=2
- c4.backdrop=opic
- case 2
- m9=2
- c7.backdrop=opic
- end select
- end if
- elseif m1=0 and m4=2 and m7=0 then
- if m2=1 then
- m1=2
- c1.backdrop=opic
- elseif m8=1 then
- m7=2
- c8.backdrop=opic
- else
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m7=2
- c7.backdrop=opic
- end select
- end if
- elseif m2=0 and m5=2 and m8=0 then
- if m1=1 or m3=1then
- m2=2
- c2.backdrop=opic
- elseif m7=1 or m9=1then
- m8=2
- c8.backdrop=opic
- else
- select case choixcase
- case 1
- m2=2
- c8.backdrop=opic
- case 2
- m8=2
- c8.backdrop=opic
- end select
- end if
- elseif m3=0 and m6=2 and m9=0 then
- if m2=1 then
- m3=2
- c3.backdrop=opic
- elseif m8=1 then
- m9=2
- c9.backdrop=opic
- else
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- end if
- elseif m1=0 and m4=0 and m7=2 then
- if m2=1 or m3=1 or m9=1 then
- m1=2
- c1.backdrop=opic
- elseif m6=1 then
- m4=2
- c4.backdrop=opic
- else
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m4=2
- c4.backdrop=opic
- end select
- end if
- elseif m2=0 and m5=0 and m8=2 then
- m5=2
- c5.backdrop=opic
- elseif m3=0 and m6=0 and m9=2 then
- if m1=1 or m2=1 or m7=1 then
- m3=2
- c3.backdrop=opic
- elseif m4=1 then
- m6=2
- c6.backdrop=opic
- else
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m6=2
- c6.backdrop=opic
- end select
- end if
- elseif m1=2 and m5=0 and m9=0 then
- m5=2
- c5.backdrop=opic
- elseif m1=0 and m5=2 and m9=0 then
- if m2=1 or m4=1 then
- m1=2
- c1.backdrop=opic
- elseif m8=1 or m6=1 then
- m9=2
- c9.backdrop=opic
- else
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- end if
- elseif m1=0 and m5=0 and m9=2 then
- m5=2
- c5.backdrop=opic
- elseif m3=2 and m5=0 and m7=0 then
- m5=2
- c5.backdrop=opic
- elseif m3=0 and m5=2 and m7=0 then
- if m2=1 or m6=1 then
- m3=2
- c3.backdrop=opic
- elseif m8=1 or m4=1 then
- m7=2
- c7.backdrop=opic
- else
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m7=2
- c7.backdrop=opic
- end select
- end if
- elseif m3=0 and m5=0 and m7=2 then
- m5=2
- c5.backdrop=opic
- // etape #6 0000000000000000000000000000000
- elseif m1=1 and m2=0 and m3=0 then
- select case choixcase
- case 1
- m2=2
- c2.backdrop=opic
- case 2
- m3=2
- c3.backdrop=opic
- end select
- elseif m4=1 and m5=0 and m6=0 then
- select case choixcase
- case 1
- m5=2
- c5.backdrop=opic
- case 2
- m6=2
- c6.backdrop=opic
- end select
- elseif m7=1 and m8=0 and m9=0 then
- select case choixcase
- case 1
- m8=2
- c8.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- elseif m1=0 and m2=1 and m3=0 then
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m3=2
- c3.backdrop=opic
- end select
- elseif m4=0 and m5=1 and m6=0 then
- select case choixcase
- case 1
- m4=2
- c4.backdrop=opic
- case 2
- m6=2
- c6.backdrop=opic
- end select
- elseif m7=0 and m8=1 and m9=0 then
- select case choixcase
- case 1
- m7=2
- c7.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- elseif m1=0 and m2=0 and m3=1 then
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m2=2
- c2.backdrop=opic
- end select
- elseif m4=0 and m5=0 and m6=1 then
- select case choixcase
- case 1
- m4=2
- c4.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- end select
- elseif m7=0 and m8=0 and m9=1 then
- select case choixcase
- case 1
- m7=2
- c7.backdrop=opic
- case 2
- m8=2
- c8.backdrop=opic
- end select
- elseif m1=1 and m4=0 and m7=0 then
- select case choixcase
- case 1
- m4=2
- c4.backdrop=opic
- case 2
- m7=2
- c7.backdrop=opic
- end select
- elseif m2=1 and m5=0 and m8=0 then
- select case choixcase
- case 1
- m2=2
- c2.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- end select
- elseif m3=1 and m6=0 and m9=0 then
- select case choixcase
- case 1
- m6=2
- c6.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- //1111111111111111111
- elseif m1=0 and m4=1 and m7=0 then
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m7=2
- c7.backdrop=opic
- end select
- elseif m2=0 and m5=1 and m8=0 then
- select case choixcase
- case 1
- m2=2
- c8.backdrop=opic
- case 2
- m8=2
- c8.backdrop=opic
- end select
- elseif m3=0 and m6=1 and m9=0 then
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- elseif m1=0 and m4=0 and m7=1 then
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m4=2
- c4.backdrop=opic
- end select
- elseif m2=0 and m5=0 and m8=1 then
- select case choixcase
- case 1
- m2=2
- c2.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- end select
- elseif m3=0 and m6=0 and m9=1 then
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m6=2
- c6.backdrop=opic
- end select
- elseif m1=1 and m5=0 and m9=0 then
- select case choixcase
- case 1
- m5=2
- c5.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- elseif m1=0 and m5=1 and m9=0 then
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m9=2
- c9.backdrop=opic
- end select
- elseif m1=0 and m5=0 and m9=2 then
- select case choixcase
- case 1
- m1=2
- c1.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- end select
- elseif m3=2 and m5=0 and m7=0 then
- select case choixcase
- case 1
- m7=2
- c7.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- end select
- elseif m3=0 and m5=1 and m7=0 then
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m7=2
- c7.backdrop=opic
- end select
- elseif m3=0 and m5=0 and m7=2 then
- select case choixcase
- case 1
- m3=2
- c3.backdrop=opic
- case 2
- m5=2
- c5.backdrop=opic
- end select
- else
- dim ok as boolean //si nous avons réussi à jouer
- while not ok
- dim nombre as byte
- nombre=floor(rnd*9)+1
- select case nombre
- case 1
- if m1=0 then
- m1=2
- c1.backdrop=opic
- ok=true
- end if
- case 2
- if m2=0 then
- m2=2
- c2.backdrop=opic
- ok=true
- end if
- case 3
- if m3=0 then
- m3=2
- c3.backdrop=opic
- ok=true
- end if
- case 4
- if m4=0 then
- m4=2
- c4.backdrop=opic
- ok=true
- end if
- case 5
- if m5=0 then
- m5=2
- c5.backdrop=opic
- ok=true
- end if
- case 6
- if m6=0 then
- m6=2
- c6.backdrop=opic
- ok=true
- end if
- case 7
- if m7=0 then
- m7=2
- c7.backdrop=opic
- ok=true
- end if
- case 8
- if m8=0 then
- m8=2
- c8.backdrop=opic
- ok=true
- end if
- case 9
- if m9=0 then
- m9=2
- c9.backdrop=opic
- ok=true
- end if
- end select
- wend
- end if
- testgagner
- tourdesx=true
- nbcoups=nbcoups+1
Add Comment
Please, Sign In to add comment