A solution to the n-queens puzzle.
Casting the puzzle as a set cover problem, it is solved using the DLX algorithm. This project is a stepping-stone to a better algorithm for my sudoku project.
> git clone git@github.com:jeffseif/queens.git
> cd queens
> make test
> ./cli --help
usage: __main__.py [-h] [--version] [size]
N-queens solver
positional arguments:
size Number of queens (e.g., 8)
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
Version 1.0.0 | Jeffrey Seifried 2016
> ./cli 4
0
+---------+
| . ♕ . . |
| . . . ♕ |
| ♕ . . . |
| . . ♕ . |
+---------+
1
+---------+
| . . ♕ . |
| ♕ . . . |
| . . . ♕ |
| . ♕ . . |
+---------+