Guest User

Untitled

a guest
Apr 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.67 KB | None | 0 0
  1.   testgagner
  2.  
  3.   dim choixcase as byte //laquelle des deux cases dois-je choisir... à utiliser dans la préparation d'une éventuelle victoire
  4.  
  5.   choixcase=floor(rnd*2)+1
  6.  
  7.   //est-ce qu'on peut gagner le prochain tour?
  8.  
  9.   if m1=2 and m2=2 and m3=0 then
  10.     m3=2
  11.     c3.backdrop=opic
  12.    
  13.   elseif m4=2 and m5=2 and m6=0 then
  14.     m6=2
  15.     c6.backdrop=opic
  16.    
  17.   elseif m7=2 and m8=2 and m9=0 then
  18.     m9=2
  19.     c9.backdrop=opic
  20.    
  21.   elseif m1=2 and m2=0 and m3=2 then
  22.     m2=2
  23.     c2.backdrop=opic
  24.    
  25.   elseif m4=2 and m5=0 and m6=2 then
  26.     m5=2
  27.     c5.backdrop=opic
  28.    
  29.   elseif m7=2 and m8=0 and m9=2 then
  30.     m8=2
  31.     c8.backdrop=opic
  32.    
  33.   elseif m1=0 and m2=2 and m3=2 then
  34.     m1=2
  35.     c1.backdrop=opic
  36.    
  37.   elseif m4=0 and m5=2 and m6=2 then
  38.     m4=2
  39.     c4.backdrop=opic
  40.    
  41.   elseif m7=0 and m8=2 and m9=2 then
  42.     m7=2
  43.     c7.backdrop=opic
  44.    
  45.   elseif m1=2 and m4=2 and m7=0 then
  46.     m7=2
  47.     c7.backdrop=opic
  48.    
  49.   elseif m2=2 and m5=2 and m8=0 then
  50.     m8=2
  51.     c8.backdrop=opic
  52.    
  53.   elseif m3=2 and m6=2 and m9=0 then
  54.     m9=2
  55.     c9.backdrop=opic
  56.    
  57.   elseif m1=2 and m4=0 and m7=2 then
  58.     m4=2
  59.     c4.backdrop=opic
  60.    
  61.   elseif m2=2 and m5=0 and m8=2 then
  62.     m5=2
  63.     c5.backdrop=opic
  64.    
  65.   elseif m3=2 and m6=0 and m9=2 then
  66.     m6=2
  67.     c6.backdrop=opic
  68.    
  69.   elseif m1=0 and m4=2 and m7=2 then
  70.     m1=2
  71.     c1.backdrop=opic
  72.    
  73.   elseif m2=0 and m5=2 and m8=2 then
  74.     m2=2
  75.     c2.backdrop=opic
  76.    
  77.   elseif m3=0 and m6=2 and m9=2 then
  78.     m3=2
  79.     c3.backdrop=opic
  80.    
  81.   elseif m1=0 and m5=2 and m9=2 then
  82.     m1=2
  83.     c1.backdrop=opic
  84.    
  85.   elseif m1=2 and m5=0 and m9=2 then
  86.     m5=2
  87.     c5.backdrop=opic
  88.    
  89.   elseif m1=2 and m5=2 and m9=0 then
  90.     m9=2
  91.     c9.backdrop=opic
  92.    
  93.   elseif m3=0 and m5=2 and m7=2 then
  94.     m3=2
  95.     c3.backdrop=opic
  96.    
  97.   elseif m3=2 and m5=0 and m7=2 then
  98.     m5=2
  99.     c5.backdrop=opic
  100.    
  101.   elseif m3=2 and m5=2 and m7=0 then
  102.     m7=2
  103.     c7.backdrop=opic
  104.    
  105.    
  106.     //si le joueur a 2 X de suite... je dois l'arrêter!
  107.    
  108.   elseif m1=1 and m2=1 and m3=0 then
  109.     m3=2
  110.     c3.backdrop=opic
  111.    
  112.   elseif m4=1 and m5=1 and m6=0 then
  113.     m6=2
  114.     c6.backdrop=opic
  115.    
  116.   elseif m7=1 and m8=1 and m9=0 then
  117.     m9=2
  118.     c9.backdrop=opic
  119.    
  120.   elseif m1=1 and m2=0 and m3=1 then
  121.     m2=2
  122.     c2.backdrop=opic
  123.    
  124.   elseif m4=1 and m5=0 and m6=1 then
  125.     m5=2
  126.     c5.backdrop=opic
  127.    
  128.   elseif m7=1 and m8=0 and m9=1 then
  129.     m8=2
  130.     c8.backdrop=opic
  131.    
  132.   elseif m1=0 and m2=1 and m3=1 then
  133.     m1=2
  134.     c1.backdrop=opic
  135.    
  136.   elseif m4=0 and m5=1 and m6=1 then
  137.     m4=2
  138.     c4.backdrop=opic
  139.    
  140.   elseif m7=0 and m8=1 and m9=1 then
  141.     m7=2
  142.     c7.backdrop=opic
  143.    
  144.   elseif m1=1 and m4=1 and m7=0 then
  145.     m7=2
  146.     c7.backdrop=opic
  147.    
  148.   elseif m2=1 and m5=1 and m8=0 then
  149.     m8=2
  150.     c8.backdrop=opic
  151.    
  152.   elseif m3=1 and m6=1 and m9=0 then
  153.     m9=2
  154.     c9.backdrop=opic
  155.    
  156.   elseif m1=1 and m4=0 and m7=1 then
  157.     m4=2
  158.     c4.backdrop=opic
  159.    
  160.   elseif m2=1 and m5=0 and m8=1 then
  161.     m5=2
  162.     c5.backdrop=opic
  163.    
  164.   elseif m3=1 and m6=0 and m9=1 then
  165.     m6=2
  166.     c6.backdrop=opic
  167.    
  168.   elseif m1=0 and m4=1 and m7=1 then
  169.     m1=2
  170.     c1.backdrop=opic
  171.    
  172.   elseif m2=0 and m5=1 and m8=1 then
  173.     m2=2
  174.     c2.backdrop=opic
  175.    
  176.   elseif m3=0 and m6=1 and m9=1 then
  177.     m3=2
  178.     c3.backdrop=opic
  179.    
  180.   elseif m1=0 and m5=1 and m9=1 then
  181.     m1=2
  182.     c1.backdrop=opic
  183.    
  184.   elseif m1=1 and m5=0 and m9=1 then
  185.     m5=2
  186.     c5.backdrop=opic
  187.    
  188.   elseif m1=1 and m5=1 and m9=0 then
  189.     m9=2
  190.     c9.backdrop=opic
  191.    
  192.   elseif m3=0 and m5=1 and m7=1 then
  193.     m3=2
  194.     c3.backdrop=opic
  195.    
  196.   elseif m3=1 and m5=0 and m7=1 then
  197.     m5=2
  198.     c5.backdrop=opic
  199.    
  200.   elseif m3=1 and m5=1 and m7=0 then
  201.     m7=2
  202.     c7.backdrop=opic
  203.    
  204.    
  205.    
  206.    
  207.   elseif nbcoups=1 then //deuxième tour
  208.    
  209.     dim coupii as byte //variable qui détermine dans quelle case il faut jouer au 2e coup
  210.    
  211.     coupii=floor(rnd*4)+1
  212.    
  213.     if m5=1 then
  214.      
  215.      
  216.       select case coupii
  217.       case 1
  218.         m1=2
  219.         c1.backdrop=opic
  220.       case 2
  221.         m3=2
  222.         c3.backdrop=opic
  223.       case 3
  224.         m7=2
  225.         c7.backdrop=opic
  226.       case 4
  227.         m9=2
  228.         c9.backdrop=opic
  229.       end select
  230.      
  231.     elseif m1=1 or m3=1 or m7=1 or m9=1 then
  232.       m5=2
  233.       c5.backdrop=opic
  234.      
  235.     elseif m2=1 then
  236.      
  237.       select case coupii
  238.       case 1
  239.         m1=2
  240.         c1.backdrop=opic
  241.       case 2
  242.         m3=2
  243.         c3.backdrop=opic
  244.       case 3
  245.         m5=2
  246.         c5.backdrop=opic
  247.       case 4
  248.         m8=2
  249.         c8.backdrop=opic
  250.       end select
  251.      
  252.     elseif m4=1 then
  253.      
  254.       select case coupii
  255.       case 1
  256.         m1=2
  257.         c1.backdrop=opic
  258.       case 2
  259.         m5=2
  260.         c5.backdrop=opic
  261.       case 3
  262.         m6=2
  263.         c6.backdrop=opic
  264.       case 4
  265.         m7=2
  266.         c7.backdrop=opic
  267.       end select
  268.      
  269.     elseif m6=1 then
  270.      
  271.       select case coupii
  272.       case 1
  273.         m3=2
  274.         c3.backdrop=opic
  275.       case 2
  276.         m4=2
  277.         c4.backdrop=opic
  278.       case 3
  279.         m5=2
  280.         c5.backdrop=opic
  281.       case 4
  282.         m9=2
  283.         c9.backdrop=opic
  284.       end select
  285.      
  286.     elseif m8=1 then
  287.      
  288.       select case coupii
  289.       case 1
  290.         m2=2
  291.         c2.backdrop=opic
  292.       case 2
  293.         m5=2
  294.         c5.backdrop=opic
  295.       case 3
  296.         m7=2
  297.         c7.backdrop=opic
  298.       case 4
  299.         m9=2
  300.         c9.backdrop=opic
  301.       end select
  302.      
  303.     end if
  304.    
  305.     //préparation d'une éventuelle victoire
  306.    
  307.   elseif m1=2 and m2=0 and m3=0 then
  308.     if m8=1 then
  309.       m2=2
  310.       c2.backdrop=opic
  311.     elseif m6=1 or m7=1 or m9=1 then
  312.       m3=2
  313.       c3.backdrop=opic
  314.     else
  315.       select case choixcase
  316.       case 1
  317.         m2=2
  318.         c2.backdrop=opic
  319.       case 2
  320.         m3=2
  321.         c3.backdrop=opic
  322.       end select
  323.     end if
  324.    
  325.   elseif m4=2 and m5=0 and m6=0 then
  326.     m5=2
  327.     c5.backdrop=opic
  328.    
  329.   elseif m7=2 and m8=0 and m9=0 then
  330.     if m2=1 then
  331.       m8=2
  332.       c8.backdrop=opic
  333.     elseif m1=1 or m3=1 or m6=1 then
  334.       m9=2
  335.       c9.backdrop=opic
  336.     else
  337.       select case choixcase
  338.       case 1
  339.         m8=2
  340.         c8.backdrop=opic
  341.       case 2
  342.         m9=2
  343.         c9.backdrop=opic
  344.       end select
  345.     end if
  346.    
  347.   elseif m1=0 and m2=2 and m3=0 then
  348.     if m4=1 then
  349.       m1=2
  350.       c1.backdrop=opic
  351.     elseif m6=1 then
  352.       m3=2
  353.       c3.backdrop=opic
  354.     else
  355.       select case choixcase
  356.       case 1
  357.         m1=2
  358.         c1.backdrop=opic
  359.       case 2
  360.         m3=2
  361.         c3.backdrop=opic
  362.       end select
  363.     end if
  364.    
  365.    
  366.   elseif m4=0 and m5=2 and m6=0 then
  367.     if m1=1 or m7=1 then
  368.       m4=2
  369.       c4.backdrop=opic
  370.     elseif m3=1 or m9=1 then
  371.       m6=2
  372.       c6.backdrop=opic
  373.     else
  374.       select case choixcase
  375.       case 1
  376.         m4=2
  377.         c4.backdrop=opic
  378.       case 2
  379.         m6=2
  380.         c6.backdrop=opic
  381.       end select
  382.     end if
  383.    
  384.   elseif m7=0 and m8=2 and m9=0 then
  385.     if m4=1 then
  386.       m7=2
  387.       c7.backdrop=opic
  388.     elseif m6=1 then
  389.       m9=2
  390.       c9.backdrop=opic
  391.     else
  392.       select case choixcase
  393.       case 1
  394.         m7=2
  395.         c7.backdrop=opic
  396.       case 2
  397.         m9=2
  398.         c9.backdrop=opic
  399.       end select
  400.     end if
  401.    
  402.   elseif m1=0 and m2=0 and m3=2 then
  403.     if m4=1 or m7=1 or m9=1 then
  404.       m1=2
  405.       c1.backdrop=opic
  406.     elseif m8=1 then
  407.       m2=2
  408.       c2.backdrop=opic
  409.     else
  410.       select case choixcase
  411.       case 1
  412.         m1=2
  413.         c1.backdrop=opic
  414.       case 2
  415.         m2=2
  416.         c2.backdrop=opic
  417.       end select
  418.     end if
  419.    
  420.   elseif m4=0 and m5=0 and m6=2 then
  421.     m5=2
  422.     c5.backdrop=opic
  423.    
  424.   elseif m7=0 and m8=0 and m9=2 then
  425.     if m4=1 or m1=1 or m3=1 then
  426.       m7=2
  427.       c7.backdrop=opic
  428.     elseif m2=1 then
  429.       m8=2
  430.       c8.backdrop=opic
  431.     else
  432.       select case choixcase
  433.       case 1
  434.         m7=2
  435.         c7.backdrop=opic
  436.       case 2
  437.         m8=2
  438.         c8.backdrop=opic
  439.       end select
  440.     end if
  441.    
  442.   elseif m1=2 and m4=0 and m7=0 then
  443.     if m8=1 or m9=1 or m3=1 then
  444.       m7=2
  445.       c7.backdrop=opic
  446.     elseif m6=1 then
  447.       m4=2
  448.       c4.backdrop=opic
  449.      
  450.     else
  451.       select case choixcase
  452.       case 1
  453.         m4=2
  454.         c4.backdrop=opic
  455.       case 2
  456.         m7=2
  457.         c7.backdrop=opic
  458.       end select
  459.     end if
  460.    
  461.   elseif m2=2 and m5=0 and m8=0 then
  462.     m5=2
  463.     c5.backdrop=opic
  464.    
  465.   elseif m3=2 and m6=0 and m9=0 then
  466.     if m8=1 or m7=1 or m1=1 then
  467.       m9=2
  468.       c9.backdrop=opic
  469.     elseif m4=1 then
  470.       m6=2
  471.       c6.backdrop=opic
  472.      
  473.     else
  474.       select case choixcase
  475.       case 1
  476.         m6=2
  477.         c4.backdrop=opic
  478.       case 2
  479.         m9=2
  480.         c7.backdrop=opic
  481.       end select
  482.     end if
  483.    
  484.    
  485.   elseif m1=0 and m4=2 and m7=0 then
  486.     if m2=1 then
  487.       m1=2
  488.       c1.backdrop=opic
  489.     elseif m8=1 then
  490.       m7=2
  491.       c8.backdrop=opic
  492.     else
  493.       select case choixcase
  494.       case 1
  495.         m1=2
  496.         c1.backdrop=opic
  497.       case 2
  498.         m7=2
  499.         c7.backdrop=opic
  500.       end select
  501.     end if
  502.    
  503.   elseif m2=0 and m5=2 and m8=0 then
  504.    
  505.     if m1=1 or m3=1then
  506.       m2=2
  507.       c2.backdrop=opic
  508.     elseif m7=1 or m9=1then
  509.       m8=2
  510.       c8.backdrop=opic
  511.     else
  512.       select case choixcase
  513.       case 1
  514.         m2=2
  515.         c8.backdrop=opic
  516.       case 2
  517.         m8=2
  518.         c8.backdrop=opic
  519.       end select
  520.     end if
  521.    
  522.   elseif m3=0 and m6=2 and m9=0 then
  523.     if m2=1 then
  524.       m3=2
  525.       c3.backdrop=opic
  526.     elseif m8=1 then
  527.       m9=2
  528.       c9.backdrop=opic
  529.     else
  530.       select case choixcase
  531.       case 1
  532.         m3=2
  533.         c3.backdrop=opic
  534.       case 2
  535.         m9=2
  536.         c9.backdrop=opic
  537.       end select
  538.     end if
  539.    
  540.   elseif m1=0 and m4=0 and m7=2 then
  541.     if m2=1 or m3=1 or m9=1 then
  542.       m1=2
  543.       c1.backdrop=opic
  544.     elseif m6=1 then
  545.       m4=2
  546.       c4.backdrop=opic
  547.     else
  548.       select case choixcase
  549.       case 1
  550.         m1=2
  551.         c1.backdrop=opic
  552.       case 2
  553.         m4=2
  554.         c4.backdrop=opic
  555.       end select
  556.     end if
  557.    
  558.   elseif m2=0 and m5=0 and m8=2 then
  559.     m5=2
  560.     c5.backdrop=opic
  561.    
  562.   elseif m3=0 and m6=0 and m9=2 then
  563.     if m1=1 or m2=1 or m7=1 then
  564.       m3=2
  565.       c3.backdrop=opic
  566.     elseif m4=1 then
  567.       m6=2
  568.       c6.backdrop=opic
  569.     else
  570.       select case choixcase
  571.       case 1
  572.         m3=2
  573.         c3.backdrop=opic
  574.       case 2
  575.         m6=2
  576.         c6.backdrop=opic
  577.       end select
  578.     end if
  579.    
  580.   elseif m1=2 and m5=0 and m9=0 then
  581.     m5=2
  582.     c5.backdrop=opic
  583.    
  584.   elseif m1=0 and m5=2 and m9=0 then
  585.     if m2=1 or m4=1 then
  586.       m1=2
  587.       c1.backdrop=opic
  588.     elseif m8=1 or m6=1 then
  589.       m9=2
  590.       c9.backdrop=opic
  591.     else
  592.       select case choixcase
  593.       case 1
  594.         m1=2
  595.         c1.backdrop=opic
  596.       case 2
  597.         m9=2
  598.         c9.backdrop=opic
  599.       end select
  600.     end if
  601.    
  602.   elseif m1=0 and m5=0 and m9=2 then
  603.     m5=2
  604.     c5.backdrop=opic
  605.    
  606.   elseif m3=2 and m5=0 and m7=0 then
  607.     m5=2
  608.     c5.backdrop=opic
  609.    
  610.   elseif m3=0 and m5=2 and m7=0 then
  611.    
  612.     if m2=1 or m6=1 then
  613.       m3=2
  614.       c3.backdrop=opic
  615.     elseif m8=1 or m4=1 then
  616.       m7=2
  617.       c7.backdrop=opic
  618.     else
  619.       select case choixcase
  620.       case 1
  621.         m3=2
  622.         c3.backdrop=opic
  623.       case 2
  624.         m7=2
  625.         c7.backdrop=opic
  626.       end select
  627.     end if
  628.    
  629.   elseif m3=0 and m5=0 and m7=2 then
  630.     m5=2
  631.     c5.backdrop=opic
  632.    
  633.     // etape #6 0000000000000000000000000000000
  634.   elseif m1=1 and m2=0 and m3=0 then
  635.     select case choixcase
  636.     case 1
  637.       m2=2
  638.       c2.backdrop=opic
  639.     case 2
  640.       m3=2
  641.       c3.backdrop=opic
  642.     end select
  643.    
  644.   elseif m4=1 and m5=0 and m6=0 then
  645.     select case choixcase
  646.     case 1
  647.       m5=2
  648.       c5.backdrop=opic
  649.     case 2
  650.       m6=2
  651.       c6.backdrop=opic
  652.     end select
  653.    
  654.   elseif m7=1 and m8=0 and m9=0 then
  655.     select case choixcase
  656.     case 1
  657.       m8=2
  658.       c8.backdrop=opic
  659.     case 2
  660.       m9=2
  661.       c9.backdrop=opic
  662.     end select
  663.    
  664.   elseif m1=0 and m2=1 and m3=0 then
  665.     select case choixcase
  666.     case 1
  667.       m1=2
  668.       c1.backdrop=opic
  669.     case 2
  670.       m3=2
  671.       c3.backdrop=opic
  672.     end select
  673.    
  674.    
  675.   elseif m4=0 and m5=1 and m6=0 then
  676.     select case choixcase
  677.     case 1
  678.       m4=2
  679.       c4.backdrop=opic
  680.     case 2
  681.       m6=2
  682.       c6.backdrop=opic
  683.     end select
  684.    
  685.   elseif m7=0 and m8=1 and m9=0 then
  686.     select case choixcase
  687.     case 1
  688.       m7=2
  689.       c7.backdrop=opic
  690.     case 2
  691.       m9=2
  692.       c9.backdrop=opic
  693.     end select
  694.    
  695.   elseif m1=0 and m2=0 and m3=1 then
  696.     select case choixcase
  697.     case 1
  698.       m1=2
  699.       c1.backdrop=opic
  700.     case 2
  701.       m2=2
  702.       c2.backdrop=opic
  703.     end select
  704.    
  705.   elseif m4=0 and m5=0 and m6=1 then
  706.     select case choixcase
  707.     case 1
  708.       m4=2
  709.       c4.backdrop=opic
  710.     case 2
  711.       m5=2
  712.       c5.backdrop=opic
  713.     end select
  714.    
  715.   elseif m7=0 and m8=0 and m9=1 then
  716.     select case choixcase
  717.     case 1
  718.       m7=2
  719.       c7.backdrop=opic
  720.     case 2
  721.       m8=2
  722.       c8.backdrop=opic
  723.     end select
  724.    
  725.   elseif m1=1 and m4=0 and m7=0 then
  726.     select case choixcase
  727.     case 1
  728.       m4=2
  729.       c4.backdrop=opic
  730.     case 2
  731.       m7=2
  732.       c7.backdrop=opic
  733.     end select
  734.    
  735.   elseif m2=1 and m5=0 and m8=0 then
  736.     select case choixcase
  737.     case 1
  738.       m2=2
  739.       c2.backdrop=opic
  740.     case 2
  741.       m5=2
  742.       c5.backdrop=opic
  743.     end select
  744.    
  745.   elseif m3=1 and m6=0 and m9=0 then
  746.     select case choixcase
  747.     case 1
  748.       m6=2
  749.       c6.backdrop=opic
  750.     case 2
  751.       m9=2
  752.       c9.backdrop=opic
  753.     end select
  754.    
  755.    
  756.     //1111111111111111111
  757.    
  758.   elseif m1=0 and m4=1 and m7=0 then
  759.     select case choixcase
  760.     case 1
  761.       m1=2
  762.       c1.backdrop=opic
  763.     case 2
  764.       m7=2
  765.       c7.backdrop=opic
  766.     end select
  767.    
  768.   elseif m2=0 and m5=1 and m8=0 then
  769.     select case choixcase
  770.     case 1
  771.       m2=2
  772.       c8.backdrop=opic
  773.     case 2
  774.       m8=2
  775.       c8.backdrop=opic
  776.     end select
  777.    
  778.   elseif m3=0 and m6=1 and m9=0 then
  779.     select case choixcase
  780.     case 1
  781.       m3=2
  782.       c3.backdrop=opic
  783.     case 2
  784.       m9=2
  785.       c9.backdrop=opic
  786.     end select
  787.    
  788.   elseif m1=0 and m4=0 and m7=1 then
  789.     select case choixcase
  790.     case 1
  791.       m1=2
  792.       c1.backdrop=opic
  793.     case 2
  794.       m4=2
  795.       c4.backdrop=opic
  796.     end select
  797.    
  798.   elseif m2=0 and m5=0 and m8=1 then
  799.     select case choixcase
  800.     case 1
  801.       m2=2
  802.       c2.backdrop=opic
  803.     case 2
  804.       m5=2
  805.       c5.backdrop=opic
  806.     end select
  807.    
  808.   elseif m3=0 and m6=0 and m9=1 then
  809.     select case choixcase
  810.     case 1
  811.       m3=2
  812.       c3.backdrop=opic
  813.     case 2
  814.       m6=2
  815.       c6.backdrop=opic
  816.     end select
  817.    
  818.   elseif m1=1 and m5=0 and m9=0 then
  819.     select case choixcase
  820.     case 1
  821.       m5=2
  822.       c5.backdrop=opic
  823.     case 2
  824.       m9=2
  825.       c9.backdrop=opic
  826.     end select
  827.    
  828.   elseif m1=0 and m5=1 and m9=0 then
  829.     select case choixcase
  830.     case 1
  831.       m1=2
  832.       c1.backdrop=opic
  833.     case 2
  834.       m9=2
  835.       c9.backdrop=opic
  836.     end select
  837.    
  838.   elseif m1=0 and m5=0 and m9=2 then
  839.     select case choixcase
  840.     case 1
  841.       m1=2
  842.       c1.backdrop=opic
  843.     case 2
  844.       m5=2
  845.       c5.backdrop=opic
  846.     end select
  847.    
  848.   elseif m3=2 and m5=0 and m7=0 then
  849.     select case choixcase
  850.     case 1
  851.       m7=2
  852.       c7.backdrop=opic
  853.     case 2
  854.       m5=2
  855.       c5.backdrop=opic
  856.     end select
  857.    
  858.   elseif m3=0 and m5=1 and m7=0 then
  859.    
  860.     select case choixcase
  861.     case 1
  862.       m3=2
  863.       c3.backdrop=opic
  864.     case 2
  865.       m7=2
  866.       c7.backdrop=opic
  867.     end select
  868.    
  869.   elseif m3=0 and m5=0 and m7=2 then
  870.     select case choixcase
  871.     case 1
  872.       m3=2
  873.       c3.backdrop=opic
  874.     case 2
  875.       m5=2
  876.       c5.backdrop=opic
  877.     end select
  878.    
  879.    
  880.   else
  881.     dim ok as boolean //si nous avons réussi à jouer
  882.     while not ok
  883.       dim nombre as byte
  884.       nombre=floor(rnd*9)+1
  885.      
  886.       select case nombre
  887.       case 1
  888.         if m1=0 then
  889.           m1=2
  890.           c1.backdrop=opic
  891.          
  892.           ok=true
  893.          
  894.         end if
  895.        
  896.       case 2
  897.         if m2=0 then
  898.            m2=2
  899.           c2.backdrop=opic
  900.          
  901.           ok=true
  902.          
  903.         end if
  904.        
  905.       case 3
  906.         if m3=0 then
  907.           m3=2
  908.           c3.backdrop=opic
  909.          
  910.           ok=true
  911.          
  912.         end if
  913.        
  914.       case 4
  915.         if m4=0 then
  916.           m4=2
  917.           c4.backdrop=opic
  918.          
  919.           ok=true
  920.          
  921.         end if
  922.        
  923.       case 5
  924.         if m5=0 then
  925.           m5=2
  926.           c5.backdrop=opic
  927.          
  928.           ok=true
  929.          
  930.         end if
  931.        
  932.       case 6
  933.         if m6=0 then
  934.           m6=2
  935.           c6.backdrop=opic
  936.          
  937.           ok=true
  938.          
  939.         end if
  940.        
  941.       case 7
  942.         if m7=0 then
  943.           m7=2
  944.           c7.backdrop=opic
  945.          
  946.           ok=true
  947.          
  948.         end if
  949.        
  950.       case 8
  951.         if m8=0 then
  952.           m8=2
  953.           c8.backdrop=opic
  954.          
  955.           ok=true
  956.          
  957.         end if
  958.        
  959.       case 9
  960.         if m9=0 then
  961.           m9=2
  962.           c9.backdrop=opic
  963.          
  964.           ok=true
  965.          
  966.         end if
  967.        
  968.       end select
  969.      
  970.     wend
  971.    
  972.   end if
  973.  
  974.  
  975.   testgagner
  976.   tourdesx=true
  977.   nbcoups=nbcoups+1
Add Comment
Please, Sign In to add comment