Find Chess960 starting position identifier: Difference between revisions
Find Chess960 starting position identifier (view source)
Revision as of 19:25, 23 July 2022
, 1 year ago→{{header|Julia}}: Correct algorithm.
(→{{header|Go}}: Fix algorithm.) |
(→{{header|Julia}}: Correct algorithm.) |
||
Line 457:
knightpos1, knightpos2 = findfirst(c -> c =='N', noQB), findlast(c -> c =='N', noQB)
N = findfirst(s -> s == 10 * knightpos1 + knightpos2, knighttable) - 1
Q = findfirst(c -> c == 'Q', replace(a, "
bishoppositions = [findfirst(c -> c =='B', a), findlast(c -> c =='B', a)]
if isodd(bishoppositions[2])
|