From 844bd0b2cdec317bfdeee4f34ab8ec6ca51b3c50 Mon Sep 17 00:00:00 2001 From: AUnicornWithNoLife Date: Sat, 10 Jul 2021 12:02:33 +0100 Subject: [PATCH] added var to control if predict should be used this will be controllable by user in future --- src/code.js | 7 +++++-- src/var.js | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/code.js b/src/code.js index 0847f39..f65fc4a 100755 --- a/src/code.js +++ b/src/code.js @@ -48,9 +48,12 @@ function move(id) resetPredict(); - var pre = calculate(ptm); + if (dopredict) + { + var pre = calculate(ptm); - board[pre[0]][pre[1]][1].parentElement.classList.add('predict'); + board[pre[0]][pre[1]][1].parentElement.classList.add('predict'); + } } function win() diff --git a/src/var.js b/src/var.js index db2f2b4..894df82 100755 --- a/src/var.js +++ b/src/var.js @@ -6,7 +6,8 @@ var ptm; var tabloid; var gamemode; var root; -var themesel +var themesel; +var dopredict; function load() { @@ -65,6 +66,8 @@ function load() themesel = document.getElementById('theme-sel'); root = document.documentElement; + + dopredict = true; info['go'].innerHTML = "X's Go";