Popular recipes tagged "queen" but not "algorithm"http://code.activestate.com/recipes/tags/queen-algorithm/2013-05-10T03:44:56-07:00ActiveState Code RecipesEight queen problem (Python)
2013-05-10T03:44:56-07:00Thomas Lehmannhttp://code.activestate.com/recipes/users/4174477/http://code.activestate.com/recipes/577438-eight-queen-problem/
<p style="color: grey">
Python
recipe 577438
by <a href="/recipes/users/4174477/">Thomas Lehmann</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/queen/">queen</a>).
Revision 5.
</p>
<p><strong>Task</strong>:</p>
<ul>
<li>Think of a chess field 8x8.</li>
<li>Place 8 queens in a way that no one threaten another one.</li>
</ul>
<p><strong>Intention</strong>:</p>
<ul>
<li>Writing an algorithm to provide all solutions</li>
<li>Adjusting the algorithm in a way that it can handle chess fields by other sizes n x n.</li>
</ul>
<p><strong>Changes</strong>:</p>
<ul>
<li><strong>Revision 5</strong>:
<ul>
<li>can run providing "n" via command line parameter and </li>
<li>run half of board adding the other solutions by mirroring (12x12 takes 4 seconds instead of 8 on my slow notebook)</li>
</ul></li>
<li>...</li>
</ul>
<p><strong>Other languages</strong>:</p>
<ul>
<li>My <a href="http://code.activestate.com/recipes/578497/">recipe 578497</a> for JavaScript</li>
<li>...</li>
</ul>