shradha-khapra / JavaScriptSeries

247 stars 210 forks source link

Tic Tac Toe -- final-move win is not counted as a win. #7

Closed daryl-micah closed 7 months ago

daryl-micah commented 9 months ago

The JS code used to decide draw says the game is drawn if a player wins on the 9th (LAST move).

KaranSinghBhandari0 commented 9 months ago

Draw condition for JavaScript code : we can initialise a count variable from 0 and keep updating by +1 after every click. The case when our count is 9 we have to display the result as Draw (Note : there may be a case where user wins on 9th count, So we have to call display the result as Draw after checkWinner function).

Sumanmethuku commented 7 months ago

Return false after for loop in checkWinner function your issue gets resolved.