Find Chess960 starting position identifier: Difference between revisions
Find Chess960 starting position identifier (view source)
Revision as of 21:08, 23 July 2022
, 1 year ago→{{header|Wren}}: Fix algorithm, add troublesome examples.
(→{{header|Ruby}}: Fix algorithm, add Unicode piece output and troublesome examples.) |
(→{{header|Wren}}: Fix algorithm, add troublesome examples.) |
||
Line 874:
var N = ntable[np]
var piecesQ = pieces.replace("
var Q = piecesQ.indexOf("Q")
Line 887:
}
for (pieces in ["♕♘♖♗♗♘♔♖", "♖♘♗♕♔♗♘♖", "♜♛♞♝♝♚♜♞", "♜♞♛♝♝♚♜♞"]) {
System.print("%(pieces) or %(g2l.call(pieces)) has SP-ID of %(spid.call(pieces))")
}</lang>
Line 895:
♕♘♖♗♗♘♔♖ or QNRBBNKR has SP-ID of 105
♖♘♗♕♔♗♘♖ or RNBQKBNR has SP-ID of 518
♜♛♞♝♝♚♜♞ or RQNBBKRN has SP-ID of 601
♜♞♛♝♝♚♜♞ or RNQBBKRN has SP-ID of 617
</pre>
|