fix bug
This commit is contained in:
parent
4f0283f48b
commit
1d4d5ad92e
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user