projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify Monster + Doublemove2. Smoother example games
[vchess.git]
/
client
/
src
/
variants
/
Teleport.js
diff --git
a/client/src/variants/Teleport.js
b/client/src/variants/Teleport.js
index
93648c4
..
6cf14a8
100644
(file)
--- a/
client/src/variants/Teleport.js
+++ b/
client/src/variants/Teleport.js
@@
-3,7
+3,8
@@
import { randInt } from "@/utils/alea";
export class TeleportRules extends ChessRules {
hoverHighlight(x, y) {
export class TeleportRules extends ChessRules {
hoverHighlight(x, y) {
- // TODO: only highlight if the move is legal
+ // Testing move validity results in an infinite update loop.
+ // TODO: find a way to test validity anyway.
return (this.subTurn == 2 && this.board[x][y] == V.EMPTY);
}
return (this.subTurn == 2 && this.board[x][y] == V.EMPTY);
}
@@
-310,8
+311,6
@@
export class TeleportRules extends ChessRules {
(color == 'w' && mvEval > m.eval) ||
(color == 'b' && mvEval < m.eval)
) {
(color == 'w' && mvEval > m.eval) ||
(color == 'b' && mvEval < m.eval)
) {
- // TODO: if many second moves have the same eval, only the
- // first is kept. Could be randomized.
m.eval = mvEval;
m.next = m2;
}
m.eval = mvEval;
m.next = m2;
}