Find Chess960 starting position identifier: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Fix algorithm, add Unicode piece output and troublesome examples.)
(→‎{{header|Wren}}: Fix algorithm, add troublesome examples.)
Line 874: Line 874:
var N = ntable[np]
var N = ntable[np]


var piecesQ = pieces.replace("N", "")
var piecesQ = pieces.replace("B", "")
var Q = piecesQ.indexOf("Q")
var Q = piecesQ.indexOf("Q")


Line 887: Line 887:
}
}


for (pieces in ["♕♘♖♗♗♘♔♖", "♖♘♗♕♔♗♘♖"]) {
for (pieces in ["♕♘♖♗♗♘♔♖", "♖♘♗♕♔♗♘♖", "♜♛♞♝♝♚♜♞", "♜♞♛♝♝♚♜♞"]) {
System.print("%(pieces) or %(g2l.call(pieces)) has SP-ID of %(spid.call(pieces))")
System.print("%(pieces) or %(g2l.call(pieces)) has SP-ID of %(spid.call(pieces))")
}</lang>
}</lang>
Line 895: Line 895:
♕♘♖♗♗♘♔♖ or QNRBBNKR has SP-ID of 105
♕♘♖♗♗♘♔♖ or QNRBBNKR has SP-ID of 105
♖♘♗♕♔♗♘♖ or RNBQKBNR has SP-ID of 518
♖♘♗♕♔♗♘♖ or RNBQKBNR has SP-ID of 518
♜♛♞♝♝♚♜♞ or RQNBBKRN has SP-ID of 601
♜♞♛♝♝♚♜♞ or RNQBBKRN has SP-ID of 617
</pre>
</pre>