Find Chess960 starting position identifier: Difference between revisions

Content added Content deleted
(→‎{{header|FreeBASIC}}: Add problematic examples.)
(→‎{{header|FreeBASIC}}: Fix variable for knight determination; N is (re)used as the knight configuration number, 0-9, based on when loop exits.)
Line 138: Line 138:


Dim As Integer N0 = 1, N1 = 2
Dim As Integer N0 = 1, N1 = 2
For i = 0 To 9
For N = 0 To 9
If N0 = pN(0) And N1 = pN(1) Then Exit For
If N0 = pN(0) And N1 = pN(1) Then Exit For
N1 += 1
N1 += 1
If N1 > 5 Then N0 += 1: N1 = N0 + 1
If N1 > 5 Then N0 += 1: N1 = N0 + 1
Next i
Next N


Q = pQ(0) - 1
Q = pQ(0) - 1