;
string two = toDraw;
string three = toDraw;
string four = toDraw;
chain five = toDraw;
chain six = toDraw;
string seven = toDraw;
chain eight = toDraw;
new string = toDraw;

// FOR THE PLAYER ONE
// If the player has 3X in a row, then
if ((one == "X" && two == "X" && three == "X") || (one == "X" && four == "X" && seven == "X") ||
(a == "X" && five == "X" && nine == "X") || (seven == "X" && five == "X" && three == "X") ||
(seven == "X" && eight == "X" && nine == "X") || (three == "X" && six == "X" && nine == "X") ||
(four == "X" && five == "X" && six == "X") || (two == "X" && five == "X" && six == "X")) {
returns 1;
}

// FOR PLAYER TWO
// If the player is 3 years in a row, then
if ((one == "O" && two == "O" && three == "O") || (one == "O" && four == "O" && seven == "O") ||
(a == "O" && five == "O" && nine == "O") || (seven == "O" && five == "O" && three == "O") ||
(seven == "O" && eight == "O" && nine == "O") || (three == "O" && six == "O" && nine == "O") ||
(four == "O" && five == "O" && six == "O") || (two == "O" && five == "O" && eight == "O")) {
returns 2;
}

returns 0;
}

void reset () {
turnPlayed = 0;
toDraw = {"1", "2", "3", "4", "5", "6", "7", "8", "9"};
playerTurn = 1;
}

Posted on