diff options
Diffstat (limited to 'html/nqueens.mu.html')
-rw-r--r-- | html/nqueens.mu.html | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/html/nqueens.mu.html b/html/nqueens.mu.html index 6035fb3d..e541430a 100644 --- a/html/nqueens.mu.html +++ b/html/nqueens.mu.html @@ -15,14 +15,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color a { text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.muData { color: #ffff00; } -.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } .Special { color: #c00000; } +.Conceal { color: #4e4e4e; } .Delimiter { color: #800080; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .LineNr { color: #444444; } -.muRecipe { color: #ff8700; } +.muControl { color: #c0a020; } +.muData { color: #ffff00; } --> </style> @@ -73,35 +74,35 @@ if ('onhashchange' in window) { <span id="L14" class="LineNr">14 </span> <span class="Comment"># if 'queens' is already long enough, print it and return</span> <span id="L15" class="LineNr">15 </span> added-so-far:num <span class="Special"><-</span> length queens <span id="L16" class="LineNr">16 </span> <span class="Delimiter">{</span> -<span id="L17" class="LineNr">17 </span> done?:bool <span class="Special"><-</span> greater-or-equal added-so-far, n -<span id="L18" class="LineNr">18 </span> <span class="muControl">break-unless</span> done? -<span id="L19" class="LineNr">19 </span> stash queens -<span id="L20" class="LineNr">20 </span> <span class="muControl">return</span><span class="Constant"> 1</span> +<span id="L17" class="LineNr">17 </span> <span class="Conceal">¦</span> done?:bool <span class="Special"><-</span> greater-or-equal added-so-far, n +<span id="L18" class="LineNr">18 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> done? +<span id="L19" class="LineNr">19 </span> <span class="Conceal">¦</span> stash queens +<span id="L20" class="LineNr">20 </span> <span class="Conceal">¦</span> <span class="muControl">return</span><span class="Constant"> 1</span> <span id="L21" class="LineNr">21 </span> <span class="Delimiter">}</span> <span id="L22" class="LineNr">22 </span> <span class="Comment"># still work to do</span> <span id="L23" class="LineNr">23 </span> next-rank:num <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span id="L24" class="LineNr">24 </span> <span class="Delimiter">{</span> -<span id="L25" class="LineNr">25 </span> <span class="muControl">break-unless</span> queens -<span id="L26" class="LineNr">26 </span> first:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> first queens -<span id="L27" class="LineNr">27 </span> existing-rank:num <span class="Special"><-</span> get first, <span class="Constant">rank:offset</span> -<span id="L28" class="LineNr">28 </span> next-rank <span class="Special"><-</span> add existing-rank,<span class="Constant"> 1</span> +<span id="L25" class="LineNr">25 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> queens +<span id="L26" class="LineNr">26 </span> <span class="Conceal">¦</span> first:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> first queens +<span id="L27" class="LineNr">27 </span> <span class="Conceal">¦</span> existing-rank:num <span class="Special"><-</span> get first, <span class="Constant">rank:offset</span> +<span id="L28" class="LineNr">28 </span> <span class="Conceal">¦</span> next-rank <span class="Special"><-</span> add existing-rank,<span class="Constant"> 1</span> <span id="L29" class="LineNr">29 </span> <span class="Delimiter">}</span> <span id="L30" class="LineNr">30 </span> result <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span id="L31" class="LineNr">31 </span> next-file:num <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span id="L32" class="LineNr">32 </span> <span class="Delimiter">{</span> -<span id="L33" class="LineNr">33 </span> done?:bool <span class="Special"><-</span> greater-or-equal next-file, n -<span id="L34" class="LineNr">34 </span> <span class="muControl">break-if</span> done? -<span id="L35" class="LineNr">35 </span> curr:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> merge next-rank, next-file -<span id="L36" class="LineNr">36 </span> <span class="Delimiter">{</span> -<span id="L37" class="LineNr">37 </span> curr-conflicts?:bool <span class="Special"><-</span> <a href='nqueens.mu.html#L49'>conflict?</a> curr, queens -<span id="L38" class="LineNr">38 </span> <span class="muControl">break-if</span> curr-conflicts? -<span id="L39" class="LineNr">39 </span> queens:&:list:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> push curr, queens -<span id="L40" class="LineNr">40 </span> sub-result:num <span class="Special"><-</span> <a href='nqueens.mu.html#L11'>nqueens</a> n, queens -<span id="L41" class="LineNr">41 </span> result <span class="Special"><-</span> add result, sub-result -<span id="L42" class="LineNr">42 </span> queens <span class="Special"><-</span> <a href='064list.mu.html#L25'>rest</a> queens -<span id="L43" class="LineNr">43 </span> <span class="Delimiter">}</span> -<span id="L44" class="LineNr">44 </span> next-file <span class="Special"><-</span> add next-file,<span class="Constant"> 1</span> -<span id="L45" class="LineNr">45 </span> <span class="muControl">loop</span> +<span id="L33" class="LineNr">33 </span> <span class="Conceal">¦</span> done?:bool <span class="Special"><-</span> greater-or-equal next-file, n +<span id="L34" class="LineNr">34 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> done? +<span id="L35" class="LineNr">35 </span> <span class="Conceal">¦</span> curr:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> merge next-rank, next-file +<span id="L36" class="LineNr">36 </span> <span class="Conceal">¦</span> <span class="Delimiter">{</span> +<span id="L37" class="LineNr">37 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> curr-conflicts?:bool <span class="Special"><-</span> <a href='nqueens.mu.html#L49'>conflict?</a> curr, queens +<span id="L38" class="LineNr">38 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> curr-conflicts? +<span id="L39" class="LineNr">39 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> queens:&:list:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> push curr, queens +<span id="L40" class="LineNr">40 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> sub-result:num <span class="Special"><-</span> <a href='nqueens.mu.html#L11'>nqueens</a> n, queens +<span id="L41" class="LineNr">41 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> result <span class="Special"><-</span> add result, sub-result +<span id="L42" class="LineNr">42 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> queens <span class="Special"><-</span> <a href='064list.mu.html#L25'>rest</a> queens +<span id="L43" class="LineNr">43 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L44" class="LineNr">44 </span> <span class="Conceal">¦</span> next-file <span class="Special"><-</span> add next-file,<span class="Constant"> 1</span> +<span id="L45" class="LineNr">45 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> <span id="L46" class="LineNr">46 </span> <span class="Delimiter">}</span> <span id="L47" class="LineNr">47 </span>] <span id="L48" class="LineNr">48 </span> @@ -119,13 +120,13 @@ if ('onhashchange' in window) { <span id="L60" class="LineNr">60 </span> <span class="Constant">load-ingredients</span> <span id="L61" class="LineNr">61 </span> curr-file:num <span class="Special"><-</span> get curr, <span class="Constant">file:offset</span> <span id="L62" class="LineNr">62 </span> <span class="Delimiter">{</span> -<span id="L63" class="LineNr">63 </span> <span class="muControl">break-unless</span> queens -<span id="L64" class="LineNr">64 </span> q:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> first queens -<span id="L65" class="LineNr">65 </span> qfile:num <span class="Special"><-</span> get q, <span class="Constant">file:offset</span> -<span id="L66" class="LineNr">66 </span> file-match?:bool <span class="Special"><-</span> equal curr-file, qfile -<span id="L67" class="LineNr">67 </span> <span class="muControl">return-if</span> file-match?, <span class="Constant">1/conflict-found</span> -<span id="L68" class="LineNr">68 </span> queens <span class="Special"><-</span> <a href='064list.mu.html#L25'>rest</a> queens -<span id="L69" class="LineNr">69 </span> <span class="muControl">loop</span> +<span id="L63" class="LineNr">63 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> queens +<span id="L64" class="LineNr">64 </span> <span class="Conceal">¦</span> q:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> first queens +<span id="L65" class="LineNr">65 </span> <span class="Conceal">¦</span> qfile:num <span class="Special"><-</span> get q, <span class="Constant">file:offset</span> +<span id="L66" class="LineNr">66 </span> <span class="Conceal">¦</span> file-match?:bool <span class="Special"><-</span> equal curr-file, qfile +<span id="L67" class="LineNr">67 </span> <span class="Conceal">¦</span> <span class="muControl">return-if</span> file-match?, <span class="Constant">1/conflict-found</span> +<span id="L68" class="LineNr">68 </span> <span class="Conceal">¦</span> queens <span class="Special"><-</span> <a href='064list.mu.html#L25'>rest</a> queens +<span id="L69" class="LineNr">69 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> <span id="L70" class="LineNr">70 </span> <span class="Delimiter">}</span> <span id="L71" class="LineNr">71 </span> <span class="muControl">return</span> <span class="Constant">0/no-conflict-found</span> <span id="L72" class="LineNr">72 </span>] @@ -136,18 +137,18 @@ if ('onhashchange' in window) { <span id="L77" class="LineNr">77 </span> curr-rank:num <span class="Special"><-</span> get curr, <span class="Constant">rank:offset</span> <span id="L78" class="LineNr">78 </span> curr-file:num <span class="Special"><-</span> get curr, <span class="Constant">file:offset</span> <span id="L79" class="LineNr">79 </span> <span class="Delimiter">{</span> -<span id="L80" class="LineNr">80 </span> <span class="muControl">break-unless</span> queens -<span id="L81" class="LineNr">81 </span> q:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> first queens -<span id="L82" class="LineNr">82 </span> qrank:num <span class="Special"><-</span> get q, <span class="Constant">rank:offset</span> -<span id="L83" class="LineNr">83 </span> qfile:num <span class="Special"><-</span> get q, <span class="Constant">file:offset</span> -<span id="L84" class="LineNr">84 </span> rank-delta:num <span class="Special"><-</span> subtract qrank, curr-rank -<span id="L85" class="LineNr">85 </span> file-delta:num <span class="Special"><-</span> subtract qfile, curr-file -<span id="L86" class="LineNr">86 </span> rank-delta <span class="Special"><-</span> <a href='070table.mu.html#L103'>abs</a> rank-delta -<span id="L87" class="LineNr">87 </span> file-delta <span class="Special"><-</span> <a href='070table.mu.html#L103'>abs</a> file-delta -<span id="L88" class="LineNr">88 </span> diagonal-match?:bool <span class="Special"><-</span> equal rank-delta, file-delta -<span id="L89" class="LineNr">89 </span> <span class="muControl">return-if</span> diagonal-match?, <span class="Constant">1/conflict-found</span> -<span id="L90" class="LineNr">90 </span> queens <span class="Special"><-</span> <a href='064list.mu.html#L25'>rest</a> queens -<span id="L91" class="LineNr">91 </span> <span class="muControl">loop</span> +<span id="L80" class="LineNr">80 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> queens +<span id="L81" class="LineNr">81 </span> <span class="Conceal">¦</span> q:<a href='nqueens.mu.html#L6'>square</a> <span class="Special"><-</span> first queens +<span id="L82" class="LineNr">82 </span> <span class="Conceal">¦</span> qrank:num <span class="Special"><-</span> get q, <span class="Constant">rank:offset</span> +<span id="L83" class="LineNr">83 </span> <span class="Conceal">¦</span> qfile:num <span class="Special"><-</span> get q, <span class="Constant">file:offset</span> +<span id="L84" class="LineNr">84 </span> <span class="Conceal">¦</span> rank-delta:num <span class="Special"><-</span> subtract qrank, curr-rank +<span id="L85" class="LineNr">85 </span> <span class="Conceal">¦</span> file-delta:num <span class="Special"><-</span> subtract qfile, curr-file +<span id="L86" class="LineNr">86 </span> <span class="Conceal">¦</span> rank-delta <span class="Special"><-</span> <a href='070table.mu.html#L103'>abs</a> rank-delta +<span id="L87" class="LineNr">87 </span> <span class="Conceal">¦</span> file-delta <span class="Special"><-</span> <a href='070table.mu.html#L103'>abs</a> file-delta +<span id="L88" class="LineNr">88 </span> <span class="Conceal">¦</span> diagonal-match?:bool <span class="Special"><-</span> equal rank-delta, file-delta +<span id="L89" class="LineNr">89 </span> <span class="Conceal">¦</span> <span class="muControl">return-if</span> diagonal-match?, <span class="Constant">1/conflict-found</span> +<span id="L90" class="LineNr">90 </span> <span class="Conceal">¦</span> queens <span class="Special"><-</span> <a href='064list.mu.html#L25'>rest</a> queens +<span id="L91" class="LineNr">91 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> <span id="L92" class="LineNr">92 </span> <span class="Delimiter">}</span> <span id="L93" class="LineNr">93 </span> <span class="muControl">return</span> <span class="Constant">0/no-conflict-found</span> <span id="L94" class="LineNr">94 </span>] |