We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 816026b + 41122ab commit bf84ea1Copy full SHA for bf84ea1
1 file changed
public/js/script.js
@@ -65,4 +65,15 @@ function checkWin(board, player) {
65
}
66
67
return gameWon;
68
-}
+}
69
+
70
+//create highlights all cells that make up a victory and prevents the user from entering any more boxes
71
+function gameOver(gameWon) {
72
+ for (let index of winCombos[gameWon.index]) {
73
+ document.getElementById(index).style.backgroundColor =
74
+ gameWon.player == oPlayer ? "blue" : "red";
75
+ }
76
+ for (var i = 0; i < cells.length; i++) {
77
+ cells[i].removeEventListener('click', turnClick, false);
78
79
0 commit comments