From 78f6a1e442d87857f0ec26b244f0ff01a9cccc71 Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Wed, 26 May 2021 11:41:20 +1000 Subject: [PATCH] Fix recursive implies --- src/drivers/webextension/css/styles.css | 2 +- src/drivers/webextension/js/tictactoe.js | 9 +++++++-- src/wappalyzer.js | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/drivers/webextension/css/styles.css b/src/drivers/webextension/css/styles.css index 9beba6a2e..1c6cbb0a1 100644 --- a/src/drivers/webextension/css/styles.css +++ b/src/drivers/webextension/css/styles.css @@ -419,7 +419,7 @@ body.dynamic-icon .category__heading:hover .category__pin { border-radius: 4px; line-height: 0; margin: auto; - width: calc(6rem + 2px); + width: 6rem; } .ttt-cell { diff --git a/src/drivers/webextension/js/tictactoe.js b/src/drivers/webextension/js/tictactoe.js index e7678329a..67ea86419 100644 --- a/src/drivers/webextension/js/tictactoe.js +++ b/src/drivers/webextension/js/tictactoe.js @@ -114,6 +114,11 @@ function check(dryrun) { complete.cells.forEach(({ el }) => el.classList.add('ttt-blink')) + if (complete.player === 'o') { + ahead.classList.add('ttt-player-icon--hidden') + behind.classList.remove('ttt-player-icon--hidden') + } + setTimeout(() => { reset() }, 1200) @@ -131,8 +136,8 @@ function play(cells) { setTimeout(() => { let found = false - search: for (const cell of cells) { - for (const player of players) { + search: for (const player of players) { + for (const cell of cells) { cell.value = player const { winner, empty } = check(true) diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 58f241a85..e0e68d70e 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -158,10 +158,10 @@ const Wappalyzer = { resolveImplies(resolved) { let done = false - while (resolved.length && !done) { - resolved.forEach(({ technology, confidence }) => { - done = true + do { + done = true + resolved.forEach(({ technology, confidence }) => { technology.implies.forEach(({ name, confidence: _confidence }) => { const implied = Wappalyzer.getTechnology(name) @@ -184,7 +184,7 @@ const Wappalyzer = { } }) }) - } + } while (resolved.length && !done) }, /**