projects
/
xogo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
99ea245
)
update
author
Benjamin Auder
<benjamin.auder@somewhere>
Tue, 24 May 2022 13:44:55 +0000
(15:44 +0200)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Tue, 24 May 2022 13:44:55 +0000
(15:44 +0200)
base_rules.js
patch
|
blob
|
blame
|
history
diff --git
a/base_rules.js
b/base_rules.js
index
9eb18fc
..
b150fcb
100644
(file)
--- a/
base_rules.js
+++ b/
base_rules.js
@@
-118,13
+118,13
@@
export default class ChessRules {
////////////////////
// COORDINATES UTILS
////////////////////
// COORDINATES UTILS
- //
a3 --> {x:10, y:3
}
+ //
3a --> {x:3, y:10
}
static SquareToCoords(sq) {
return ArrayFun.toObject(["x", "y"],
[0, 1].map(i => parseInt(sq[i], 36)));
}
static SquareToCoords(sq) {
return ArrayFun.toObject(["x", "y"],
[0, 1].map(i => parseInt(sq[i], 36)));
}
- // {x:1
, y:12} --> 1
c
+ // {x:1
1, y:12} --> b
c
static CoordsToSquare(cd) {
return Object.values(cd).map(c => c.toString(36)).join("");
}
static CoordsToSquare(cd) {
return Object.values(cd).map(c => c.toString(36)).join("");
}
@@
-162,12
+162,12
@@
export default class ChessRules {
// Turn "wb" into "B" (for FEN)
board2fen(b) {
// Turn "wb" into "B" (for FEN)
board2fen(b) {
- return
b[0] == "w" ? b[1].toUpperCase() : b[1]
;
+ return
(b[0] == "w" ? b[1].toUpperCase() : b[1])
;
}
// Turn "p" into "bp" (for board)
fen2board(f) {
}
// Turn "p" into "bp" (for board)
fen2board(f) {
- return
f.charCodeAt(0) <= 90 ? "w" + f.toLowerCase() : "b" + f
;
+ return
(f.charCodeAt(0) <= 90 ? "w" + f.toLowerCase() : "b" + f)
;
}
// Setup the initial random-or-not (asymmetric-or-not) position
}
// Setup the initial random-or-not (asymmetric-or-not) position
@@
-1347,8
+1347,6
@@
export default class ChessRules {
});
}
});
}
-// TODO: pawnfall + Cannibal issues
-
pawnPostProcess(moves, color, oppCol) {
let moreMoves = [];
const lastRank = (color == "w" ? 0 : this.size.x - 1);
pawnPostProcess(moves, color, oppCol) {
let moreMoves = [];
const lastRank = (color == "w" ? 0 : this.size.x - 1);