This commit is contained in:
AUnicornWithNoLife 2023-01-11 22:59:50 +00:00
parent 4f0283f48b
commit 1d4d5ad92e
2 changed files with 17 additions and 0 deletions

View File

@ -194,4 +194,18 @@ function resetPredict()
function aiswitch() function aiswitch()
{ {
dopredict = !dopredict; dopredict = !dopredict;
dopredictbutton.innerHTML = "AI: " + (dopredict ? "On" : "Off");
if (dopredict)
{
var pre = calculate(ptm);
board[pre[0]][pre[1]][1].parentElement.classList.add('predict');
}
else
{
resetPredict();
}
} }

View File

@ -10,6 +10,7 @@ var gamemode;
var root; var root;
var themesel; var themesel;
var dopredict; var dopredict;
var dopredictbutton;
// called when all the resources for the page have been loaded // called when all the resources for the page have been loaded
@ -77,6 +78,8 @@ function load()
info['go'].innerHTML = "X's Go"; info['go'].innerHTML = "X's Go";
dopredictbutton = document.getElementById('ai');
setup(); setup();
} }