Ejemplo n.º 1
0
 void Ruch_SI() //ruch komputera
 {
     if (trwa)
     {
         if (s0 && gra.kolej == 0 && Czy_nie_pat(0))
         {
             SI si = new SI(gra, 0);
             wybor = si.Wybor();
             if (!gra.seria)
             {
                 ObslugaPlanszy(0);
             }
             wybor = si.Cel();
             ObslugaPlanszy(0);
         }
         else if (s1 && gra.kolej == 1 && Czy_nie_pat(1))
         {
             SI si = new SI(gra, 1);
             wybor = si.Wybor();
             if (!gra.seria)
             {
                 ObslugaPlanszy(0);
             }
             wybor = si.Cel();
             ObslugaPlanszy(0);
         }
     }
 }
Ejemplo n.º 2
0
        bool Czy_nie_pat(int gracz)//wykrywa sytuacje bez mozliwosci ruchu
        {
            SI si = new SI(gra, gracz);

            if (si.Wybor() == null)
            {
                trwa        = false;
                label1.Text = "!!!Koniec gry!!!";
                return(false);
            }
            else
            {
                return(true);
            }
        }