Command-line driver of NQueens problem.
Problem: Place N queens on a board so no queen threatens another.
_|_|_|_|_|Q|_|_ _|_|_|Q|_|_|_|_ _|_|_|_|_|_|Q|_ Q|_|_|_|_|_|_|_ _|_|_|_|_|_|_|Q _|Q|_|_|_|_|_|_ _|_|_|_|Q|_|_|_ _|_|Q|_|_|_|_|_
The queens can't occupy the same row, column or diagonal.
Example:
NQueens.solve(8)
A brute-force heuristic is used to search the possibilities. Complexity severely limits the capability to solve bases larger than 13.
Problem: Place N queens on a board so no queen threatens another.
The queens can't occupy the same row, column or diagonal.
Example:
NQueens.solve(8)
A brute-force heuristic is used to search the possibilities. Complexity severely limits the capability to solve bases larger than 13.