Check out Janggi (Korean Chess), our featured variant for December, 2024.

Enter Your Reply

The Comment You're Replying To
H. G. Muller wrote on Fri, Jul 17, 2020 08:36 AM UTC:

A FIDE Pawn would be ifmnDfmWfceF . The ifmnD is the initial (i) non-jumping (n) double push. The e in fceF indicates it can e.p. capture. (An inD move automatically generates e.p. rights on the square it passes through.) The Play-Test Applet offers several different Pawn types with predefined move; if you use that to create the Diagram, be sure to pick the correct one.

As to your Middle Xiangqi Diagram: there is no standard feature to confine pieces to the Palace, but it would pay attention to a user-suppled JavaScript function called 'BadZone' on the same page that tells it where pieces of a certain type are not allowed to go. It is also possible to provide a function 'Shade' to force a different checkering pattern. In the Diagram I made for regular Xiangqi I accompanied it with

      <script>
        function BadZone(x, y, piece, color) { // enforce board zones
          if(touched) return 0; // not during ShowMoves()
          if(piece == 4) return (color ? y < 5 : y > 4); // Elephant: across river
          if(piece != 3 && piece != 8) return 0; // otherwise OK if not Advisor or King
          return x < 3 || x > 5 || (color ? y < 7 : y > 2) && (board[y][x] & 511) != 8;
        }
        function Shade(x, y) {
          var col = 0;
          if(y > 4) col = !col;
          if(x > 2 && x < 6 && (y < 3 || y > 6)) col= !col;
          return col;
        }
      </script>

In this diagram piece 4 was the Elephant (but it seems your Elephant can cross the River, so you would not need that line) and 3 and 8 were Advisor and King. The Shade function colors both board halves differently (y > 4, for ranks 5-9), and gives the Palace the opposit shade of the half it is on.

Unfortunately there is no way to use those functions if there is more than one Diagram on the same page: all Diagrams would then use them, as there is no way to indicate to which diagram they belong. Perhaps I should design a solution for that.

[Edit] I now made it possible to force diagrams to ignore the presence of a function BadZone or Shade on the page, by including the parameters zonal=0 or shady=0 . That means still at most one Diagram on a page can use such functions. But they are supposed to be only rarely needed, and one doesn't need multiple Diagrams on the same page often anyway.


Edit Form

You may not post a new comment, because ItemID MSlusus-chess does not match any item.