updateEnlightened()
{
- const pawnShift = {"w":-1, "b":1};
- // Initialize with pieces positions (which are seen)
for (let i=0; i<V.size.x; i++)
{
for (let j=0; j<V.size.y; j++)
{
this.enlightened["w"][i][j] = false;
this.enlightened["b"][i][j] = false;
+ }
+ }
+ const pawnShift = {"w":-1, "b":1};
+ // Initialize with pieces positions (which are seen)
+ for (let i=0; i<V.size.x; i++)
+ {
+ for (let j=0; j<V.size.y; j++)
+ {
if (this.board[i][j] != V.EMPTY)
{
const color = this.getColor(i,j);
getAllValidMoves()
{
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
let potentialMoves = [];
for (let i=0; i<V.size.x; i++)
{
{
super.unupdateVariables(move);
const c = move.vanish[0].c;
- const oppCol = this.getOppCol(c);
+ const oppCol = V.GetOppCol(c);
if (this.kingPos[oppCol][0] < 0)
{
// Last move took opponent's king
{
const maxeval = V.INFINITY;
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
const pawnShift = (color == "w" ? -1 : 1);
const kp = this.kingPos[color];