A small program that outputs the solutions to the n_queens problem.
Because it uses the AWESOME backtracking algorithm! (yep, just for fun)
compile: gcc n_queens.c -o queenie
run: ./queenie N
, where N is the chessboard size (1 to 16)
Obs: N values higher than 13 will take a while to solve...
From left to right: The first digit represents the position of the first queen in the first column (index starting at 0).
The n-th digit represents the position of the n-th queen in the n-th column.
Index ranges from 0-9 then A-F.
Example:
The output of ./queenie 4
is:
1302
2031
number of solutions: 2