projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Alice almost fixed
[vchess.git]
/
public
/
javascripts
/
base_rules.js
diff --git
a/public/javascripts/base_rules.js
b/public/javascripts/base_rules.js
index
5b0d5d1
..
346eff0
100644
(file)
--- a/
public/javascripts/base_rules.js
+++ b/
public/javascripts/base_rules.js
@@
-1011,18
+1011,18
@@
class ChessRules
}
// Translate final square
}
// Translate final square
-
le
t finalSquare =
+
cons
t finalSquare =
String.fromCharCode(97 + move.end.y) + (VariantRules.size[0]-move.end.x);
String.fromCharCode(97 + move.end.y) + (VariantRules.size[0]-move.end.x);
-
le
t piece = this.getPiece(move.start.x, move.start.y);
+
cons
t piece = this.getPiece(move.start.x, move.start.y);
if (piece == VariantRules.PAWN)
{
// Pawn move
let notation = "";
if (piece == VariantRules.PAWN)
{
// Pawn move
let notation = "";
- if (move.vanish.length >
1
)
+ if (move.vanish.length >
move.appear.length
)
{
// Capture
{
// Capture
-
le
t startColumn = String.fromCharCode(97 + move.start.y);
+
cons
t startColumn = String.fromCharCode(97 + move.start.y);
notation = startColumn + "x" + finalSquare;
}
else //no capture
notation = startColumn + "x" + finalSquare;
}
else //no capture
@@
-1035,7
+1035,8
@@
class ChessRules
else
{
// Piece movement
else
{
// Piece movement
- return piece.toUpperCase() + (move.vanish.length > 1 ? "x" : "") + finalSquare;
+ return piece.toUpperCase() +
+ (move.vanish.length > move.appear.length ? "x" : "") + finalSquare;
}
}
}
}