Ruby solver for the n-queens problem