From 6ee740cebd8767f4b894bfb3f72ef3e4b89a9aa9 Mon Sep 17 00:00:00 2001 From: adrien Date: Fri, 31 Mar 2023 01:55:12 +0200 Subject: [PATCH] onhashchange --- js/sudoku.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/sudoku.js b/js/sudoku.js index 42e2fea..8436fc2 100755 --- a/js/sudoku.js +++ b/js/sudoku.js @@ -103,6 +103,12 @@ function loadSavedGame() { } } +onhashchange = function(event) { + loadSavedGame() + boxes.forEach(box => searchCandidatesOf(box)) + refreshUI() +} + function searchCandidatesOf(box) { box.candidates = new Set(VALUES) box.neighbourhood.forEach(neighbour => box.candidates.delete(neighbour.value))