Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WhoWin(board, round) {
- if (board is ended) return Evaluate(board);
- if (round == 'X') {
- result = "O wins";
- for (nextboard in all possible next move) {
- nextresult = WhoWin(nextboard, 'O');
- if (nextresult == "X wins") {
- result = "X wins";
- } else if (nextresult == "Draw" && result == "O wins") {
- result = "Draw";
- }
- }
- return result;
- } else {
- // ... likewise
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment