Find Chess960 starting position identifier: Difference between revisions

→‎{{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, "NB" => "")) - 1
bishoppositions = [findfirst(c -> c =='B', a), findlast(c -> c =='B', a)]
if isodd(bishoppositions[2])
1,479

edits