N Queens
Details
In chess, pieces move on a board of 8 ranks and 8 files. A chess queen can attack along a file a rank or a diagonal. It is possible to place 8 queens on the board, such that no queen is under attack by another one. When we list the rank on which the queen is for each file, one solution looks like this
63571428
Print all solutions to the N queens problem, one per a line, for boards of sizes 4-8.
The output judge is order agnostic. The expected output shown is one of many valid outputs.
0 bytes, 0 chars
Restore solution
Compiled from
AT&T syntax to x86-64 Linux. Use
syscalls to write output.
Fennel is an experimental language, no solutions will be saved.
Please leave feedback on the
GitHub issue.
ctrl + enter or