Fix Shogi.js
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 27 Apr 2021 16:27:04 +0000 (18:27 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 27 Apr 2021 16:27:04 +0000 (18:27 +0200)
TODO
client/src/variants/Shogi.js

diff --git a/TODO b/TODO
index ad45355..9706a01 100644 (file)
--- a/TODO
+++ b/TODO
@@ -36,3 +36,8 @@ A player wins by checkmating the opponent. Note that the coin can be used to rem
 https://www.chessvariants.com/other.dir/nemoroth.html :-)
 
 Chagagne ^^
 https://www.chessvariants.com/other.dir/nemoroth.html :-)
 
 Chagagne ^^
+
+Power Sharing
+Rules: Two adjacent pieces of the same color can share their movement. Adjacency includes diagonals, sharing ends once pieces are separated, and sharing can be used to check, capture pieces, and promote pawns.
+(+ pawns and king ?!)
+TheGoatMan Discord https://discord.com/channels/686736099959504907/687076968046395410/836274318480113686
index 1526aab..5f85e75 100644 (file)
@@ -490,13 +490,13 @@ export class ShogiRules extends ChessRules {
     return false;
   }
 
     return false;
   }
 
-  isAttackedBySilver([x, y], color) {
+  isAttackedBySilver(sq, color) {
     const shift = (color == 'w' ? 1 : -1);
     return this.isAttackedBySlideNJump(
       sq, color, V.SILVER, V.steps[V.BISHOP].concat([ [shift, 0] ]), 1);
   }
 
     const shift = (color == 'w' ? 1 : -1);
     return this.isAttackedBySlideNJump(
       sq, color, V.SILVER, V.steps[V.BISHOP].concat([ [shift, 0] ]), 1);
   }
 
-  isAttackedByPawn([x, y], color) {
+  isAttackedByPawn(sq, color) {
     const shift = (color == 'w' ? 1 : -1);
     return this.isAttackedBySlideNJump(sq, color, V.PAWN, [ [shift, 0] ], 1);
   }
     const shift = (color == 'w' ? 1 : -1);
     return this.isAttackedBySlideNJump(sq, color, V.PAWN, [ [shift, 0] ], 1);
   }