Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tic tac toe v2.0
- // autor jakub molinski
- #include <iostream>
- #include <conio.h>
- #include <time.h>
- #include <cstdlib>
- #include <windows.h>
- using namespace std;
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- int table[9] = {49, 50, 51, 52, 53, 54, 55, 56, 57};
- string gracz;
- string ak_gracz;
- int pole;
- const string cross = "Krzyzyk";
- const string circle = "Kolko";
- bool koniec = false;
- bool remis = false;
- bool puste = false;
- char wybor;
- int wybrane_pole;
- int ktora_kwestia = 0;
- char znak_kompa;
- string kto_wygral;
- bool pierwszy_raz = true;
- int przegrane;
- int wygrane;
- int remisy;
- bool pierwszy_ruch = false;
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void inicjuj_gre();
- void rysuj_plansze();
- bool zmien_pole(int);
- void ruch_mkika();
- bool sprawdz_kto_wygral();
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- int main()
- {
- for (;;)
- {
- inicjuj_gre();
- if (pierwszy_raz == true)
- {
- cout << "Jestem MKiK, czyli Mistrzem gry Kolko i Krzyzyk!" << endl;
- cout << "Chcialbym z Toba zagrac!" << endl;
- cout << "Mam nadzieje, ze moje komentarze nie beda Ci przeszkadzaly..." << endl << endl;
- Sleep(3000);
- cout << "Zaczynajmy!";
- Sleep(2000);
- pierwszy_raz = false;
- }
- while ((koniec == false)&&(remis == false))
- {
- if(pierwszy_ruch == true)
- {
- ktora_kwestia = 1;
- rysuj_plansze();
- ruch_mkika();
- Sleep(1500);
- ktora_kwestia = 2;
- rysuj_plansze();
- Sleep(1000);
- ktora_kwestia = 0;
- pierwszy_ruch = false;
- }
- else
- {
- rysuj_plansze();
- }
- for (;;)
- {
- do
- {
- rysuj_plansze();
- pole = getch();
- if ((pole > (char)48)&&(pole < (char)58))
- {
- puste = zmien_pole(pole);
- if (puste == false)
- {
- cout << endl << endl << "Pole zajete!";
- getch();
- rysuj_plansze();
- }
- }
- else
- {
- cout << endl << endl << "Bledny numer pola!";
- puste = false;
- getch();
- }
- }
- while (puste == false);
- sprawdz_kto_wygral();
- if ((koniec == true)||(remis == true)) break;
- ktora_kwestia = 1;
- rysuj_plansze();
- ruch_mkika();
- Sleep(1500);
- ktora_kwestia = 2;
- rysuj_plansze();
- Sleep(1000);
- ktora_kwestia = 0;
- sprawdz_kto_wygral();
- if ((koniec == true)||(remis == true)) break;
- }
- }
- for (;;)
- {
- rysuj_plansze();
- wybor = getch();
- if ((wybor == 't')||
- (wybor == 'T'))
- {
- inicjuj_gre();
- break;
- }
- if ((wybor == 'n')||
- (wybor == 'N'))
- {
- break;
- }
- }
- if ((wybor == 'n')||
- (wybor == 'N'))
- {
- break;
- }
- }
- return 0;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void inicjuj_gre()
- {
- srand(time(NULL));
- if ((rand()%2) == 0)
- {
- ak_gracz = cross;
- gracz = ak_gracz;
- znak_kompa = 'O';
- }
- else
- {
- ak_gracz = circle;
- gracz = ak_gracz;
- znak_kompa = 'X';
- pierwszy_ruch = true;
- }
- for (int i = 0; i < 9; i++)
- {
- table[i] = 49+i;
- }
- kto_wygral = "";
- koniec = false;
- remis = false;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void rysuj_plansze()
- {
- system("cls");
- cout << " " << "KOLKO I KRZYZYK" << endl;
- if (ktora_kwestia == 0)
- {
- cout << endl << endl << endl << endl;
- }
- else if (ktora_kwestia == 1)
- {
- cout << endl << endl;
- cout << "MKiK: Daj mi pomyslec...";
- cout << endl << endl;
- }
- else if (ktora_kwestia == 2)
- {
- cout << endl << endl;
- cout << "MKiK: Wybieram pole numer: " << wybrane_pole;
- cout << endl << endl;
- }
- cout << " " << (char)table[0] << " | " << (char)table[1] << " | " << (char)table[2] << endl;
- cout << " " << "--+---+--" << endl;
- cout << " " << (char)table[3] << " | " << (char)table[4] << " | " << (char)table[5] << endl;
- cout << " " << "--+---+--" << endl;
- cout << " " << (char)table[6] << " | " << (char)table[7] << " | " << (char)table[8] << endl;
- cout << endl << endl << endl;
- if ((koniec == false)&&(remis == false))
- {
- cout << "Twoj znak: " << ak_gracz << endl;
- cout << "Znak MKiK'a: ";
- if (ak_gracz == cross) cout << circle << endl;
- else cout << cross << endl;
- }
- cout << endl;
- cout << "Wygrane: " << wygrane << endl;
- cout << "Przegrane: " << przegrane << endl;
- cout << "Remisy: " << remisy;
- cout << endl << endl << endl;
- cout << "Wybierz pole: ";
- if (koniec == true)
- {
- cout << endl;
- if (kto_wygral == "user")
- {
- cout << "Brawo!!! Wygrales!" << endl << endl;
- wygrane++;
- }
- if (kto_wygral == "komp")
- {
- cout << "Niestety! Wygral MKiK!" << endl << endl;
- przegrane++;
- }
- cout << "Czy chcesz zagrac jeszcze raz? (T/N)";
- }
- if (remis == true)
- {
- cout << endl;
- cout << "Gra zakonczyla sie remisem!" << endl << endl;
- cout << "Czy chcesz zagrac jeszcze raz? (T/N)";
- remisy++;
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- bool zmien_pole(int pole)
- {
- switch(pole)
- {
- case 49:
- if (table[0] == 49)
- {
- if (ak_gracz == cross) table[0] = 88;
- else table[0] = 79;
- return true;
- }
- else return false;
- case 50:
- if (table[1] == 50)
- {
- if (ak_gracz == cross) table[1] = 88;
- else table[1] = 79;
- return true;
- }
- else return false;
- case 51:
- if (table[2] == 51)
- {
- if (ak_gracz == cross) table[2] = 88;
- else table[2] = 79;
- return true;
- }
- else return false;
- case 52:
- if (table[3] == 52)
- {
- if (ak_gracz == cross) table[3] = 88;
- else table[3] = 79;
- return true;
- }
- else return false;
- case 53:
- if (table[4] == 53)
- {
- if (ak_gracz == cross) table[4] = 88;
- else table[4] = 79;
- return true;
- }
- else return false;
- case 54:
- if (table[5] == 54)
- {
- if (ak_gracz == cross) table[5] = 88;
- else table[5] = 79;
- return true;
- }
- else return false;
- case 55:
- if (table[6] == 55)
- {
- if (ak_gracz == cross) table[6] = 88;
- else table[6] = 79;
- return true;
- }
- else return false;
- case 56:
- if (table[7] == 56)
- {
- if (ak_gracz == cross) table[7] = 88;
- else table[7] = 79;
- return true;
- }
- else return false;
- case 57:
- if (table[8] == 57)
- {
- if (ak_gracz == cross) table[8] = 88;
- else table[8] = 79;
- return true;
- }
- else return false;
- }
- return true;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- bool sprawdz_kto_wygral()
- {
- if (
- ((table[0] == table[1])&&(table[0] == table[2])&&(static_cast<char>(table[0]) == znak_kompa))||
- ((table[3] == table[4])&&(table[3] == table[5])&&(static_cast<char>(table[3]) == znak_kompa))||
- ((table[6] == table[7])&&(table[6] == table[8])&&(static_cast<char>(table[6]) == znak_kompa))||
- ((table[0] == table[3])&&(table[0] == table[6])&&(static_cast<char>(table[0]) == znak_kompa))||
- ((table[1] == table[4])&&(table[1] == table[7])&&(static_cast<char>(table[1]) == znak_kompa))||
- ((table[2] == table[5])&&(table[2] == table[8])&&(static_cast<char>(table[2]) == znak_kompa))||
- ((table[0] == table[4])&&(table[0] == table[8])&&(static_cast<char>(table[0]) == znak_kompa))||
- ((table[2] == table[4])&&(table[2] == table[6])&&(static_cast<char>(table[2]) == znak_kompa))
- )
- {
- koniec = true;
- kto_wygral = "komp";
- return true;
- }
- if (
- (table[0] == table[1])&&(table[0] == table[2])||
- (table[3] == table[4])&&(table[3] == table[5])||
- (table[6] == table[7])&&(table[6] == table[8])||
- (table[0] == table[3])&&(table[0] == table[6])||
- (table[1] == table[4])&&(table[1] == table[7])||
- (table[2] == table[5])&&(table[2] == table[8])||
- (table[0] == table[4])&&(table[0] == table[8])||
- (table[2] == table[4])&&(table[2] == table[6])
- )
- {
- koniec = true;
- kto_wygral = "user";
- return true;
- }
- if ((table[0] != 49)&&
- (table[1] != 50)&&
- (table[2] != 51)&&
- (table[3] != 52)&&
- (table[4] != 53)&&
- (table[5] != 54)&&
- (table[6] != 55)&&
- (table[7] != 56)&&
- (table[8] != 57))
- {
- remis = true;
- }
- return true;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void ruch_mkika()
- {
- ////////////// zacznij
- if(pierwszy_ruch == true)
- {
- int d = rand()%18;
- if (d == 0)
- {
- if(table[0] == 49)
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- }
- if (d == 1)
- {
- if(table[1] == 50)
- {
- if (ak_gracz == cross) table[1] = 79;
- else table[1] = 88;
- wybrane_pole = 2;
- return;
- }
- }
- if (d == 2)
- {
- if(table[2] == 51)
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- }
- if (d == 3)
- {
- if(table[3] == 52)
- {
- if (ak_gracz == cross) table[3] = 79;
- else table[3] = 88;
- wybrane_pole = 4;
- return;
- }
- }
- if (d == 4)
- {
- if(table[5] == 54)
- {
- if (ak_gracz == cross) table[5] = 79;
- else table[5] = 88;
- wybrane_pole = 6;
- return;
- }
- }
- if (d == 5)
- {
- if(table[6] == 55)
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- }
- if (d == 6)
- {
- if(table[7] == 56)
- {
- if (ak_gracz == cross) table[7] = 79;
- else table[7] = 88;
- wybrane_pole = 8;
- return;
- }
- }
- if (d == 7)
- {
- if(table[8] == 57)
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- }
- else
- {
- if(table[4] == 53)
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- }
- }
- //////////// atak
- if((table[0] == table[2])&&(static_cast<char>(table[0]) == znak_kompa)&&(table[1] == 50))
- {
- if (ak_gracz == cross) table[1] = 79;
- else table[1] = 88;
- wybrane_pole = 2;
- return;
- }
- if((table[3] == table[5])&&(static_cast<char>(table[3]) == znak_kompa)&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[6] == table[8])&&(static_cast<char>(table[6]) == znak_kompa)&&(table[7] == 56))
- {
- if (ak_gracz == cross) table[7] = 79;
- else table[7] = 88;
- wybrane_pole = 8;
- return;
- }
- if((table[0] == table[6])&&(static_cast<char>(table[0]) == znak_kompa)&&(table[3] == 52))
- {
- if (ak_gracz == cross) table[3] = 79;
- else table[3] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[1] == table[7])&&(static_cast<char>(table[1]) == znak_kompa)&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[2] == table[8])&&(static_cast<char>(table[2]) == znak_kompa)&&(table[5] == 54))
- {
- if (ak_gracz == cross) table[5] = 79;
- else table[5] = 88;
- wybrane_pole = 6;
- return;
- }
- if((table[0] == table[8])&&(static_cast<char>(table[0]) == znak_kompa)&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[2] == table[6])&&(static_cast<char>(table[2]) == znak_kompa)&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[0] == table[1])&&(static_cast<char>(table[0]) == znak_kompa)&&(table[2] == 51))
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[1] == table[2])&&(static_cast<char>(table[1]) == znak_kompa)&&(table[0] == 49))
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- if((table[3] == table[4])&&(static_cast<char>(table[3]) == znak_kompa)&&(table[5] == 54))
- {
- if (ak_gracz == cross) table[5] = 79;
- else table[5] = 88;
- wybrane_pole = 6;
- return;
- }
- if((table[4] == table[5])&&(static_cast<char>(table[4]) == znak_kompa)&&(table[3] == 52))
- {
- if (ak_gracz == cross) table[3] = 79;
- else table[3] = 88;
- wybrane_pole = 4;
- return;
- }
- if((table[6] == table[7])&&(static_cast<char>(table[6]) == znak_kompa)&&(table[8] == 57))
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- if((table[7] == table[8])&&(static_cast<char>(table[7]) == znak_kompa)&&(table[6] == 55))
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- if((table[0] == table[3])&&(static_cast<char>(table[0]) == znak_kompa)&&(table[6] == 55))
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- if((table[1] == table[4])&&(static_cast<char>(table[1]) == znak_kompa)&&(table[7] == 56))
- {
- if (ak_gracz == cross) table[7] = 79;
- else table[7] = 88;
- wybrane_pole = 8;
- return;
- }
- if((table[2] == table[5])&&(static_cast<char>(table[2]) == znak_kompa)&&(table[8] == 57))
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- if((table[3] == table[6])&&(static_cast<char>(table[3]) == znak_kompa)&&(table[0] == 49))
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- if((table[4] == table[7])&&(static_cast<char>(table[4]) == znak_kompa)&&(table[1] == 50))
- {
- if (ak_gracz == cross) table[1] = 79;
- else table[1] = 88;
- wybrane_pole = 2;
- return;
- }
- if((table[5] == table[8])&&(static_cast<char>(table[5]) == znak_kompa)&&(table[2] == 51))
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[2] == table[4])&&(static_cast<char>(table[2]) == znak_kompa)&&(table[6] == 55))
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- if((table[6] == table[4])&&(static_cast<char>(table[6]) == znak_kompa)&&(table[2] == 51))
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[4] == table[8])&&(static_cast<char>(table[4]) == znak_kompa)&&(table[0] == 49))
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- if((table[0] == table[4])&&(static_cast<char>(table[0]) == znak_kompa)&&(table[8] == 57))
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- ///////////// obrona
- if((table[0] == table[2])&&(table[1] == 50))
- {
- if (ak_gracz == cross) table[1] = 79;
- else table[1] = 88;
- wybrane_pole = 2;
- return;
- }
- if((table[3] == table[5])&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[6] == table[8])&&(table[7] == 56))
- {
- if (ak_gracz == cross) table[7] = 79;
- else table[7] = 88;
- wybrane_pole = 8;
- return;
- }
- if((table[0] == table[6])&&(table[3] == 52))
- {
- if (ak_gracz == cross) table[3] = 79;
- else table[3] = 88;
- wybrane_pole = 4;
- return;
- }
- if((table[1] == table[7])&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[2] == table[8])&&(table[5] == 54))
- {
- if (ak_gracz == cross) table[5] = 79;
- else table[5] = 88;
- wybrane_pole = 6;
- return;
- }
- if((table[0] == table[8])&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[2] == table[6])&&(table[4] == 53))
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- if((table[0] == table[1])&&(table[2] == 51))
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[1] == table[2])&&(table[0] == 49))
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- if((table[3] == table[4])&&(table[5] == 54))
- {
- if (ak_gracz == cross) table[5] = 79;
- else table[5] = 88;
- wybrane_pole = 6;
- return;
- }
- if((table[4] == table[5])&&(table[3] == 52))
- {
- if (ak_gracz == cross) table[3] = 79;
- else table[3] = 88;
- wybrane_pole = 4;
- return;
- }
- if((table[6] == table[7])&&(table[8] == 57))
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- if((table[7] == table[8])&&(table[6] == 55))
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- if((table[0] == table[3])&&(table[6] == 55))
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- if((table[1] == table[4])&&(table[7] == 56))
- {
- if (ak_gracz == cross) table[7] = 79;
- else table[7] = 88;
- wybrane_pole = 8;
- return;
- }
- if((table[2] == table[5])&&(table[8] == 57))
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- if((table[3] == table[6])&&(table[0] == 49))
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- if((table[4] == table[7])&&(table[1] == 50))
- {
- if (ak_gracz == cross) table[1] = 79;
- else table[1] = 88;
- wybrane_pole = 2;
- return;
- }
- if((table[5] == table[8])&&(table[2] == 51))
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[2] == table[4])&&(table[6] == 55))
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- if((table[6] == table[4])&&(table[2] == 51))
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- if((table[4] == table[8])&&(table[0] == 49))
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- if((table[0] == table[4])&&(table[8] == 57))
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- ///////////////// poczatek gry
- // zaczyna na srodku
- if(
- (table[4] != 53)&&
- (table[0] == 49)&&
- (table[1] == 50)&&
- (table[2] == 51)&&
- (table[3] == 52)&&
- (table[5] == 54)&&
- (table[6] == 55)&&
- (table[7] == 56)&&
- (table[8] == 57)
- )
- {
- int d = rand()%4;
- if (d == 0)
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- }
- else if (d == 1)
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- }
- else if (d == 2)
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- }
- else if (d == 3)
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- }
- return;
- }
- // zaczyna w innym miejscu
- if(
- (table[4] == 53)&&
- (
- (table[0] != 49)||
- (table[1] != 50)||
- (table[2] != 51)||
- (table[3] != 52)||
- (table[5] != 54)||
- (table[6] != 55)||
- (table[7] != 56)||
- (table[8] != 57)
- )
- )
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- else
- {
- for(;;)
- {
- int d = rand()%9;
- if (d == 0)
- {
- if(table[0] == 49)
- {
- if (ak_gracz == cross) table[0] = 79;
- else table[0] = 88;
- wybrane_pole = 1;
- return;
- }
- }
- if (d == 1)
- {
- if(table[1] == 50)
- {
- if (ak_gracz == cross) table[1] = 79;
- else table[1] = 88;
- wybrane_pole = 2;
- return;
- }
- }
- if (d == 2)
- {
- if(table[2] == 51)
- {
- if (ak_gracz == cross) table[2] = 79;
- else table[2] = 88;
- wybrane_pole = 3;
- return;
- }
- }
- if (d == 3)
- {
- if(table[3] == 52)
- {
- if (ak_gracz == cross) table[3] = 79;
- else table[3] = 88;
- wybrane_pole = 4;
- return;
- }
- }
- if (d == 4)
- {
- if(table[4] == 53)
- {
- if (ak_gracz == cross) table[4] = 79;
- else table[4] = 88;
- wybrane_pole = 5;
- return;
- }
- }
- if (d == 5)
- {
- if(table[5] == 54)
- {
- if (ak_gracz == cross) table[5] = 79;
- else table[5] = 88;
- wybrane_pole = 6;
- return;
- }
- }
- if (d == 6)
- {
- if(table[6] == 55)
- {
- if (ak_gracz == cross) table[6] = 79;
- else table[6] = 88;
- wybrane_pole = 7;
- return;
- }
- }
- if (d == 7)
- {
- if(table[7] == 56)
- {
- if (ak_gracz == cross) table[7] = 79;
- else table[7] = 88;
- wybrane_pole = 8;
- return;
- }
- }
- if (d == 8)
- {
- if(table[8] == 57)
- {
- if (ak_gracz == cross) table[8] = 79;
- else table[8] = 88;
- wybrane_pole = 9;
- return;
- }
- }
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement