From a4ad545fc0da39216f5ccd8c217d633b7127d945 Mon Sep 17 00:00:00 2001 From: ANURAG-PATHAK Date: Sun, 8 Aug 2021 18:32:15 +0530 Subject: [PATCH] issue #33 solved --- tictactoe/6/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tictactoe/6/script.js b/tictactoe/6/script.js index cfb1697..5140681 100644 --- a/tictactoe/6/script.js +++ b/tictactoe/6/script.js @@ -28,7 +28,8 @@ function startGame() { function turnClick(square) { if (typeof origBoard[square.target.id] == 'number') { turn(square.target.id, huPlayer) - if (!checkTie()) turn(bestSpot(), aiPlayer); + if (!checkTie() && !checkWin(origBoard, huPlayer)) turn(bestSpot(), aiPlayer); + } }