N-queens problem: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Thundergnat (talk | contribs) m (fix markup) |
||
Line 4,664: | Line 4,664: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
<syntaxhighlight>subr show_sol |
<syntaxhighlight lang="easylang">subr show_sol |
||
print "Solution " & n_sol |
print "Solution " & n_sol |
||
print "" |
print "" |
||
Line 5,209: | Line 5,209: | ||
=={{header|ERRE}}== |
=={{header|ERRE}}== |
||
<syntaxhighlight> |
<syntaxhighlight lang="erre"> |
||
!------------------------------------------------ |
!------------------------------------------------ |
||
! QUEENS.R : solve queens problem on a NxN board |
! QUEENS.R : solve queens problem on a NxN board |
||
Line 5,345: | Line 5,345: | ||
The output: |
The output: |
||
<pre> |
|||
<syntaxhighlight> |
|||
| | | |X| | | | | | |
| | | |X| | | | | | |
||
| |X| | | | | | | | |
| |X| | | | | | | | |
||
Line 5,367: | Line 5,367: | ||
10 724 |
10 724 |
||
11 2680 |
11 2680 |
||
</pre> |
|||
</syntaxhighlight> |
|||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
Line 14,734: | Line 14,734: | ||
=={{header|Scilab}}== |
=={{header|Scilab}}== |
||
Naive brute-force search. |
Naive brute-force search. |
||
<syntaxhighlight>//Length of board side |
<syntaxhighlight lang="scilab">//Length of board side |
||
Board_size = 8; |
Board_size = 8; |
||
Line 16,574: | Line 16,574: | ||
(either by XSLT processors saxon-6.5.5, xsltproc, xalan, |
(either by XSLT processors saxon-6.5.5, xsltproc, xalan, |
||
or any of the big5 browsers): |
or any of the big5 browsers): |
||
<pre> |
|||
<syntaxhighlight> |
|||
15863724 |
15863724 |
||
16837425 |
16837425 |
||
Line 16,580: | Line 16,580: | ||
83162574 |
83162574 |
||
84136275 |
84136275 |
||
</pre> |
|||
</syntaxhighlight> |
|||
You can view the results directly in your browser (Chrome/FF/IE/Opera/Safari) here: [[http://stamm-wilbrandt.de/en/xsl-list/n-queens/8-queens.xsl.xml]] |
You can view the results directly in your browser (Chrome/FF/IE/Opera/Safari) here: [[http://stamm-wilbrandt.de/en/xsl-list/n-queens/8-queens.xsl.xml]] |