projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename getOppCol into static GetOppCol + start thinking about problems page
[vchess.git]
/
public
/
javascripts
/
variants
/
Dark.js
diff --git
a/public/javascripts/variants/Dark.js
b/public/javascripts/variants/Dark.js
index
f1bd6c0
..
e1ab30d
100644
(file)
--- a/
public/javascripts/variants/Dark.js
+++ b/
public/javascripts/variants/Dark.js
@@
-16,14
+16,20
@@
class DarkRules extends ChessRules
updateEnlightened()
{
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;
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);
if (this.board[i][j] != V.EMPTY)
{
const color = this.getColor(i,j);
@@
-59,7
+65,7
@@
class DarkRules extends ChessRules
getAllValidMoves()
{
const color = this.turn;
getAllValidMoves()
{
const color = this.turn;
- const oppCol =
this.g
etOppCol(color);
+ const oppCol =
V.G
etOppCol(color);
let potentialMoves = [];
for (let i=0; i<V.size.x; i++)
{
let potentialMoves = [];
for (let i=0; i<V.size.x; i++)
{
@@
-106,7
+112,7
@@
class DarkRules extends ChessRules
{
super.unupdateVariables(move);
const c = move.vanish[0].c;
{
super.unupdateVariables(move);
const c = move.vanish[0].c;
- const oppCol =
this.g
etOppCol(c);
+ const oppCol =
V.G
etOppCol(c);
if (this.kingPos[oppCol][0] < 0)
{
// Last move took opponent's king
if (this.kingPos[oppCol][0] < 0)
{
// Last move took opponent's king
@@
-140,7
+146,7
@@
class DarkRules extends ChessRules
{
const maxeval = V.INFINITY;
const color = this.turn;
{
const maxeval = V.INFINITY;
const color = this.turn;
- const oppCol =
this.g
etOppCol(color);
+ const oppCol =
V.G
etOppCol(color);
const pawnShift = (color == "w" ? -1 : 1);
const kp = this.kingPos[color];
const pawnShift = (color == "w" ? -1 : 1);
const kp = this.kingPos[color];