fix bug
This commit is contained in:
parent
4f0283f48b
commit
1d4d5ad92e
@ -194,4 +194,18 @@ function resetPredict()
|
||||
function aiswitch()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ var gamemode;
|
||||
var root;
|
||||
var themesel;
|
||||
var dopredict;
|
||||
var dopredictbutton;
|
||||
|
||||
// called when all the resources for the page have been loaded
|
||||
|
||||
@ -77,6 +78,8 @@ function load()
|
||||
|
||||
info['go'].innerHTML = "X's Go";
|
||||
|
||||
dopredictbutton = document.getElementById('ai');
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user