http://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/N-Queens