Add a button for resetting the game
This commit is contained in:
parent
ba28926219
commit
7950572ede
2 changed files with 8 additions and 0 deletions
|
@ -9,5 +9,8 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="board" id="board">
|
<div class="board" id="board">
|
||||||
</div>
|
</div>
|
||||||
|
<button class="button new-game">
|
||||||
|
New Game
|
||||||
|
</button>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -14,6 +14,11 @@ function initialize()
|
||||||
{
|
{
|
||||||
game = new Game("board");
|
game = new Game("board");
|
||||||
game.initialize();
|
game.initialize();
|
||||||
|
|
||||||
|
(/** @type {HTMLElement} */ (document.querySelector(".new-game"))).onclick = () =>
|
||||||
|
{
|
||||||
|
game.reset();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
|
Loading…
Reference in a new issue