See http://rubberduckygames.com/n-queens/