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
/
Atomic.js
diff --git
a/public/javascripts/variants/Atomic.js
b/public/javascripts/variants/Atomic.js
index
2adb988
..
255444f
100644
(file)
--- a/
public/javascripts/variants/Atomic.js
+++ b/
public/javascripts/variants/Atomic.js
@@
-90,7
+90,7
@@
class AtomicRules 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[c][0],this.kingPos[oppCol][0]].some(e => { return e < 0; }))
{
// There is a chance that last move blowed some king away..
if ([this.kingPos[c][0],this.kingPos[oppCol][0]].some(e => { return e < 0; }))
{
// There is a chance that last move blowed some king away..
@@
-104,7
+104,7
@@
class AtomicRules extends ChessRules
underCheck(color)
{
underCheck(color)
{
- const oppCol =
this.g
etOppCol(color);
+ const oppCol =
V.G
etOppCol(color);
let res = undefined;
// If our king disappeared, move is not valid
if (this.kingPos[color][0] < 0)
let res = undefined;
// If our king disappeared, move is not valid
if (this.kingPos[color][0] < 0)
@@
-122,7
+122,7
@@
class AtomicRules extends ChessRules
{
let res = [ ];
if (this.kingPos[color][0] >= 0 //king might have exploded
{
let res = [ ];
if (this.kingPos[color][0] >= 0 //king might have exploded
- && this.isAttacked(this.kingPos[color], [
this.g
etOppCol(color)]))
+ && this.isAttacked(this.kingPos[color], [
V.G
etOppCol(color)]))
{
res = [ JSON.parse(JSON.stringify(this.kingPos[color])) ]
}
{
res = [ JSON.parse(JSON.stringify(this.kingPos[color])) ]
}
@@
-135,7
+135,7
@@
class AtomicRules extends ChessRules
const kp = this.kingPos[color];
if (kp[0] < 0) //king disappeared
return color == "w" ? "0-1" : "1-0";
const kp = this.kingPos[color];
if (kp[0] < 0) //king disappeared
return color == "w" ? "0-1" : "1-0";
- if (!this.isAttacked(kp, [
this.g
etOppCol(color)]))
+ if (!this.isAttacked(kp, [
V.G
etOppCol(color)]))
return "1/2";
return color == "w" ? "0-1" : "1-0"; //checkmate
}
return "1/2";
return color == "w" ? "0-1" : "1-0"; //checkmate
}