MCPcopy Create free account
hub / github.com/codemistic/Web-Development / resetGameStatus

Function resetGameStatus

Tic-tac-toe using JS/scripts/game.js:1–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1function resetGameStatus(){
2 activePlayer=0;
3 currentRound=0;
4 gameOver.firstElementChild.innerHTML='You Won,<span id="winner">Player name</span>!';
5 gameOver.style.display='none';
6
7 let gameBoardIndex=0;
8 for(let i=0;i<3;i++){
9 for(let j=0;j<3;j++){
10 gameData[i][j]=0;
11 const gameBoardItemElement=gameboard.children[gameBoardIndex];
12 gameBoardItemElement.textContent='';
13 gameBoardItemElement.classList.remove('disabled')
14 gameBoardIndex++;
15 }
16 }
17}
18
19
20

Callers 1

startNewGameFunction · 0.85

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected