Open henrylin03 opened 2 months ago
for some reason, the alert shows before the board is reprinted even though it's not ordered that way in the if condition block in updateGrids() method of the screen controller factory (createScreenController)
if
updateGrids()
createScreenController
current code:
//createScreenController.js function updateScreen() { ... // run createGrids(); updateGrids(); if (game.activePlayerWins()) { disableClicksOnOpponentsBoard(); const activePlayer = game.getActivePlayer(); const alertText = activePlayer.isComputer() ? "Computer wins" : "You win"; return alert(alertText); } }
can use a similar modal in tic-tac-toe project: https://github.com/henrylin03/tic-tac-toe
for some reason, the alert shows before the board is reprinted even though it's not ordered that way in the
if
condition block inupdateGrids()
method of the screen controller factory (createScreenController
)current code: