about summary refs log tree commit diff stats
path: root/html/nqueens.mu.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-11-22 11:14:43 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-11-22 11:14:43 -0800
commit93c9862fa74043f2b0fa616fcc28aee66bc05037 (patch)
tree7c1439b100a09c1db34aa51cc5d545ce76cdde89 /html/nqueens.mu.html
parent79cb6ea54e7ef76cf3768ec06a0510296b8ac5e9 (diff)
downloadmu-93c9862fa74043f2b0fa616fcc28aee66bc05037.tar.gz
3681
Couple of fixes to example programs.
Diffstat (limited to 'html/nqueens.mu.html')
-rw-r--r--html/nqueens.mu.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/html/nqueens.mu.html b/html/nqueens.mu.html
index efddcc92..1053e8da 100644
--- a/html/nqueens.mu.html
+++ b/html/nqueens.mu.html
@@ -41,7 +41,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   file:num
 ]
 
-<span class="muRecipe">def</span> nqueens n:num, queens:&amp;:list:square<span class="muRecipe"> -&gt; </span>result:num [
+<span class="muRecipe">def</span> nqueens n:num, queens:&amp;:list:square<span class="muRecipe"> -&gt; </span>result:num, queens:&amp;:list:square [
   <span class="Constant">local-scope</span>
   <span class="Constant">load-ingredients</span>
   <span class="Comment"># if 'queens' is already long enough, print it and return</span>
@@ -69,9 +69,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     <span class="Delimiter">{</span>
       curr-conflicts?:bool <span class="Special">&lt;-</span> conflict? curr, queens
       <span class="muControl">break-if</span> curr-conflicts?
-      new-queens:&amp;:list:square <span class="Special">&lt;-</span> push curr, queens
-      sub-result:num <span class="Special">&lt;-</span> nqueens n, new-queens
+      queens:&amp;:list:square <span class="Special">&lt;-</span> push curr, queens
+      sub-result:num <span class="Special">&lt;-</span> nqueens n, queens
       result <span class="Special">&lt;-</span> add result, sub-result
+      queens <span class="Special">&lt;-</span> rest queens
     <span class="Delimiter">}</span>
     next-file <span class="Special">&lt;-</span> add next-file,<span class="Constant"> 1</span>
     <span class="muControl">loop</span>