Arc Forumnew | comments | leaders | submitlogin
1 point by lojic 6095 days ago | link | parent

When I run this via (nqueens 8), I only get one output:

  arc> (nqueens 8)
  (2 4 6 8 3 1 7 5)  
  arc>
There should be 92 solutions displayed.


1 point by cchooper 6095 days ago | link

This algorithm only finds one correct solution for each n.

-----

1 point by map 6095 days ago | link

The wikipedia algorithm only generates one solution.

-----

1 point by lojic 6095 days ago | link

The challenge is to produce all 92 solutions as the Ruby code does in the OP. I linked to wikipedia for the description of the problem, not the algorithm.

I also showed the ellided output for clarification.

-----

1 point by cchooper 6095 days ago | link

I was doing the n queens challenge on Wikipedia because someone had already posted a solution to your challenge.

-----