// Do not cheat: the current enlightment is all we can see
const myLight = JSON.parse(JSON.stringify(this.enlightened[color]));
// Do not cheat: the current enlightment is all we can see
const myLight = JSON.parse(JSON.stringify(this.enlightened[color]));
// Can a slider on (i,j) apparently take my king?
// NOTE: inaccurate because assume yes if some squares are shadowed
const sliderTake = ([i,j], piece) => {
// Can a slider on (i,j) apparently take my king?
// NOTE: inaccurate because assume yes if some squares are shadowed
const sliderTake = ([i,j], piece) => {
- let x=kp[0]+step[0], y=kp[1]+step[1];
- x != i && y != j;
- x += step[0], y+= step[1])
- {
+ let x=kp[0]+step[0], y=kp[1]+step[1];
+ x != i && y != j;
+ x += step[0], y += step[1])
+ {