Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,32 @@
-V BoardSize = 8
F underAttack(col, queens)
I col C queens
R 1B
L(x) queens
I abs(col - x) == queens.len - L.index
R 1B
R 0B
F solve(n)
V result = [[Int]()]
[[Int]] newSolutions
L(row) 1 .. n
L(solution) result
L(i) 1 .. BoardSize
I !underAttack(i, solution)
newSolutions.append(solution [+] [i])
swap(&result, &newSolutions)
newSolutions.clear()
R result
print(Solutions for a chessboard of size String(BoardSize)xString(BoardSize))
print()
L(answer) solve(BoardSize)
L(col) answer
V row = L.index
I row > 0
print( , end' )
print(Char(code' a.code + row)col, end' )
print(end' I L.index % 4 == 3 {"\n"} E )