adrien1018

Untitled

Apr 9th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. WhoWin(board, round) {
  2. if (board is ended) return Evaluate(board);
  3. if (round == 'X') {
  4. result = "O wins";
  5. for (nextboard in all possible next move) {
  6. nextresult = WhoWin(nextboard, 'O');
  7. if (nextresult == "X wins") {
  8. result = "X wins";
  9. } else if (nextresult == "Draw" && result == "O wins") {
  10. result = "Draw";
  11. }
  12. }
  13. return result;
  14. } else {
  15. // ... likewise
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment