From 7950572edeecd59d7c8211ca8379dcd33f6c3d81 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 13 Dec 2022 11:08:52 +0100 Subject: [PATCH] Add a button for resetting the game --- src/index.html | 3 +++ src/js/main.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/index.html b/src/index.html index 4bcff3a..2e6144f 100644 --- a/src/index.html +++ b/src/index.html @@ -9,5 +9,8 @@
+ diff --git a/src/js/main.js b/src/js/main.js index 36ea495..d431c5d 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -14,6 +14,11 @@ function initialize() { game = new Game("board"); game.initialize(); + + (/** @type {HTMLElement} */ (document.querySelector(".new-game"))).onclick = () => + { + game.reset(); + }; } initialize();