diff options
Diffstat (limited to 'html/chessboard.mu.html')
-rw-r--r-- | html/chessboard.mu.html | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/html/chessboard.mu.html b/html/chessboard.mu.html index c72e498a..3e4b09c8 100644 --- a/html/chessboard.mu.html +++ b/html/chessboard.mu.html @@ -90,10 +90,10 @@ if ('onhashchange' in window) { <span id="L30" class="LineNr"> 30 </span><span class="Constant">]</span> <span id="L31" class="LineNr"> 31 </span> ] <span id="L32" class="LineNr"> 32 </span> run [ -<span id="L33" class="LineNr"> 33 </span> screen:&:screen, console:&:console <span class="Special"><-</span> chessboard screen:&:screen, console:&:console +<span id="L33" class="LineNr"> 33 </span> <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, <a href='084console.mu.html#L23'>console</a>:&:<a href='084console.mu.html#L23'>console</a> <span class="Special"><-</span> chessboard <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, <a href='084console.mu.html#L23'>console</a>:&:<a href='084console.mu.html#L23'>console</a> <span id="L34" class="LineNr"> 34 </span> <span class="Comment"># icon for the cursor</span> <span id="L35" class="LineNr"> 35 </span> cursor-icon:char <span class="Special"><-</span> copy <span class="Constant">9251/␣</span> -<span id="L36" class="LineNr"> 36 </span> screen <span class="Special"><-</span> print screen, cursor-icon +<span id="L36" class="LineNr"> 36 </span> <a href='081print.mu.html#L4'>screen</a> <span class="Special"><-</span> print <a href='081print.mu.html#L4'>screen</a>, cursor-icon <span id="L37" class="LineNr"> 37 </span> ] <span id="L38" class="LineNr"> 38 </span> screen-should-contain [ <span id="L39" class="LineNr"> 39 </span> <span class="Comment"># 1 2 3 4 5 6 7 8 9 10 11</span> @@ -125,37 +125,37 @@ if ('onhashchange' in window) { <span id="L65" class="LineNr"> 65 </span> <span id="L66" class="LineNr"> 66 </span><span class="muData">type</span> board = &:@:&:@:char <span class="Comment"># a 2-D array of arrays of characters</span> <span id="L67" class="LineNr"> 67 </span> -<span id="L68" class="LineNr"> 68 </span><span class="muRecipe">def</span> chessboard screen:&:screen, console:&:console<span class="muRecipe"> -> </span>screen:&:screen, console:&:console [ +<span id="L68" class="LineNr"> 68 </span><span class="muRecipe">def</span> chessboard <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, <a href='084console.mu.html#L23'>console</a>:&:<a href='084console.mu.html#L23'>console</a><span class="muRecipe"> -> </span><a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, <a href='084console.mu.html#L23'>console</a>:&:<a href='084console.mu.html#L23'>console</a> [ <span id="L69" class="LineNr"> 69 </span> <span class="Constant">local-scope</span> <span id="L70" class="LineNr"> 70 </span> <span class="Constant">load-ingredients</span> <span id="L71" class="LineNr"> 71 </span> board:board <span class="Special"><-</span> initial-position <span id="L72" class="LineNr"> 72 </span> <span class="Comment"># hook up stdin</span> -<span id="L73" class="LineNr"> 73 </span> stdin-in:&:source:char, stdin-out:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">10/capacity</span> -<span id="L74" class="LineNr"> 74 </span> start-running send-keys-to-channel, console, stdin-out, screen +<span id="L73" class="LineNr"> 73 </span> stdin-in:&:source:char, stdin-out:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">10/capacity</span> +<span id="L74" class="LineNr"> 74 </span> start-running <a href='084console.mu.html#L73'>send-keys-to-channel</a>, <a href='084console.mu.html#L23'>console</a>, stdin-out, <a href='081print.mu.html#L4'>screen</a> <span id="L75" class="LineNr"> 75 </span> <span class="Comment"># buffer lines in stdin</span> -<span id="L76" class="LineNr"> 76 </span> buffered-stdin-in:&:source:char, buffered-stdin-out:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">10/capacity</span> -<span id="L77" class="LineNr"> 77 </span> start-running buffer-lines, stdin-in, buffered-stdin-out +<span id="L76" class="LineNr"> 76 </span> buffered-stdin-in:&:source:char, buffered-stdin-out:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">10/capacity</span> +<span id="L77" class="LineNr"> 77 </span> start-running <a href='075channel.mu.html#L388'>buffer-lines</a>, stdin-in, buffered-stdin-out <span id="L78" class="LineNr"> 78 </span> <span class="Delimiter">{</span> -<span id="L79" class="LineNr"> 79 </span> print screen, <span class="Constant">[Stupid text-mode chessboard. White pieces in uppercase; black pieces in lowercase. No checking for legal moves.</span> +<span id="L79" class="LineNr"> 79 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[Stupid text-mode chessboard. White pieces in uppercase; black pieces in lowercase. No checking for legal moves.</span> <span id="L80" class="LineNr"> 80 </span><span class="Constant">]</span> -<span id="L81" class="LineNr"> 81 </span> cursor-to-next-line screen -<span id="L82" class="LineNr"> 82 </span> print-board screen, board -<span id="L83" class="LineNr"> 83 </span> cursor-to-next-line screen -<span id="L84" class="LineNr"> 84 </span> print screen, <span class="Constant">[Type in your move as <from square>-<to square>. For example: 'a2-a4'. Then press <enter>.</span> +<span id="L81" class="LineNr"> 81 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> +<span id="L82" class="LineNr"> 82 </span> print-board <a href='081print.mu.html#L4'>screen</a>, board +<span id="L83" class="LineNr"> 83 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> +<span id="L84" class="LineNr"> 84 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[Type in your move as <from square>-<to square>. For example: 'a2-a4'. Then press <enter>.</span> <span id="L85" class="LineNr"> 85 </span><span class="Constant">]</span> -<span id="L86" class="LineNr"> 86 </span> cursor-to-next-line screen -<span id="L87" class="LineNr"> 87 </span> print screen <span class="Constant">[Hit 'q' to exit.</span> +<span id="L86" class="LineNr"> 86 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> +<span id="L87" class="LineNr"> 87 </span> print <a href='081print.mu.html#L4'>screen</a> <span class="Constant">[Hit 'q' to exit.</span> <span id="L88" class="LineNr"> 88 </span><span class="Constant">]</span> <span id="L89" class="LineNr"> 89 </span> <span class="Delimiter">{</span> -<span id="L90" class="LineNr"> 90 </span> cursor-to-next-line screen -<span id="L91" class="LineNr"> 91 </span> screen <span class="Special"><-</span> print screen, <span class="Constant">[move: ]</span> -<span id="L92" class="LineNr"> 92 </span> m:&:move, quit:bool, error:bool <span class="Special"><-</span> read-move buffered-stdin-in, screen +<span id="L90" class="LineNr"> 90 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> +<span id="L91" class="LineNr"> 91 </span> <a href='081print.mu.html#L4'>screen</a> <span class="Special"><-</span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[move: ]</span> +<span id="L92" class="LineNr"> 92 </span> m:&:move, quit:bool, error:bool <span class="Special"><-</span> read-move buffered-stdin-in, <a href='081print.mu.html#L4'>screen</a> <span id="L93" class="LineNr"> 93 </span> <span class="muControl">break-if</span> quit, <span class="Constant">+quit</span> -<span id="L94" class="LineNr"> 94 </span> buffered-stdin-in <span class="Special"><-</span> clear buffered-stdin-in <span class="Comment"># cleanup after error. todo: test this?</span> +<span id="L94" class="LineNr"> 94 </span> buffered-stdin-in <span class="Special"><-</span> <a href='075channel.mu.html#L161'>clear</a> buffered-stdin-in <span class="Comment"># cleanup after error. todo: test this?</span> <span id="L95" class="LineNr"> 95 </span> <span class="muControl">loop-if</span> error <span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">}</span> <span id="L97" class="LineNr"> 97 </span> board <span class="Special"><-</span> make-move board, m -<span id="L98" class="LineNr"> 98 </span> screen <span class="Special"><-</span> clear-screen screen +<span id="L98" class="LineNr"> 98 </span> <a href='081print.mu.html#L4'>screen</a> <span class="Special"><-</span> <a href='081print.mu.html#L27'>clear-screen</a> <a href='081print.mu.html#L4'>screen</a> <span id="L99" class="LineNr"> 99 </span> <span class="muControl">loop</span> <span id="L100" class="LineNr">100 </span> <span class="Delimiter">}</span> <span id="L101" class="LineNr">101 </span><span class="Constant"> +quit</span> @@ -200,7 +200,7 @@ if ('onhashchange' in window) { <span id="L140" class="LineNr">140 </span> <span class="Delimiter">}</span> <span id="L141" class="LineNr">141 </span>] <span id="L142" class="LineNr">142 </span> -<span id="L143" class="LineNr">143 </span><span class="muRecipe">def</span> print-board screen:&:screen, board:board<span class="muRecipe"> -> </span>screen:&:screen [ +<span id="L143" class="LineNr">143 </span><span class="muRecipe">def</span> print-board <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, board:board<span class="muRecipe"> -> </span><a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> [ <span id="L144" class="LineNr">144 </span> <span class="Constant">local-scope</span> <span id="L145" class="LineNr">145 </span> <span class="Constant">load-ingredients</span> <span id="L146" class="LineNr">146 </span> row:num <span class="Special"><-</span> copy<span class="Constant"> 7</span> <span class="Comment"># start printing from the top of the board</span> @@ -211,8 +211,8 @@ if ('onhashchange' in window) { <span id="L151" class="LineNr">151 </span> <span class="muControl">break-if</span> done? <span id="L152" class="LineNr">152 </span> <span class="Comment"># print rank number as a legend</span> <span id="L153" class="LineNr">153 </span> rank:num <span class="Special"><-</span> add row,<span class="Constant"> 1</span> -<span id="L154" class="LineNr">154 </span> print-integer screen, rank -<span id="L155" class="LineNr">155 </span> print screen, <span class="Constant">[ | ]</span> +<span id="L154" class="LineNr">154 </span> <a href='081print.mu.html#L687'>print-integer</a> <a href='081print.mu.html#L4'>screen</a>, rank +<span id="L155" class="LineNr">155 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[ | ]</span> <span id="L156" class="LineNr">156 </span> <span class="Comment"># print each square in the row</span> <span id="L157" class="LineNr">157 </span> col:num <span class="Special"><-</span> copy<span class="Constant"> 0</span> <span id="L158" class="LineNr">158 </span> <span class="Delimiter">{</span> @@ -220,20 +220,20 @@ if ('onhashchange' in window) { <span id="L160" class="LineNr">160 </span> <span class="muControl">break-if</span> done?:bool <span id="L161" class="LineNr">161 </span> f:&:@:char <span class="Special"><-</span> index *board, col <span id="L162" class="LineNr">162 </span> c:char <span class="Special"><-</span> index *f, row -<span id="L163" class="LineNr">163 </span> print screen, c -<span id="L164" class="LineNr">164 </span> print screen, space +<span id="L163" class="LineNr">163 </span> print <a href='081print.mu.html#L4'>screen</a>, c +<span id="L164" class="LineNr">164 </span> print <a href='081print.mu.html#L4'>screen</a>, space <span id="L165" class="LineNr">165 </span> col <span class="Special"><-</span> add col,<span class="Constant"> 1</span> <span id="L166" class="LineNr">166 </span> <span class="muControl">loop</span> <span id="L167" class="LineNr">167 </span> <span class="Delimiter">}</span> <span id="L168" class="LineNr">168 </span> row <span class="Special"><-</span> subtract row,<span class="Constant"> 1</span> -<span id="L169" class="LineNr">169 </span> cursor-to-next-line screen +<span id="L169" class="LineNr">169 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> <span id="L170" class="LineNr">170 </span> <span class="muControl">loop</span> <span id="L171" class="LineNr">171 </span> <span class="Delimiter">}</span> <span id="L172" class="LineNr">172 </span> <span class="Comment"># print file letters as legend</span> -<span id="L173" class="LineNr">173 </span> print screen, <span class="Constant">[ +----------------]</span> -<span id="L174" class="LineNr">174 </span> cursor-to-next-line screen -<span id="L175" class="LineNr">175 </span> print screen, <span class="Constant">[ a b c d e f g h]</span> -<span id="L176" class="LineNr">176 </span> cursor-to-next-line screen +<span id="L173" class="LineNr">173 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[ +----------------]</span> +<span id="L174" class="LineNr">174 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> +<span id="L175" class="LineNr">175 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[ a b c d e f g h]</span> +<span id="L176" class="LineNr">176 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> <span id="L177" class="LineNr">177 </span>] <span id="L178" class="LineNr">178 </span> <span id="L179" class="LineNr">179 </span><span class="muRecipe">def</span> initial-position<span class="muRecipe"> -> </span>board:board [ @@ -247,7 +247,7 @@ if ('onhashchange' in window) { <span id="L187" class="LineNr">187 </span> <span class="Comment"># B P _ _ _ _ p B</span> <span id="L188" class="LineNr">188 </span> <span class="Comment"># N P _ _ _ _ p n</span> <span id="L189" class="LineNr">189 </span> <span class="Comment"># R P _ _ _ _ p r</span> -<span id="L190" class="LineNr">190 </span> initial-position:&:@:char <span class="Special"><-</span> new-array <span class="Constant">82/R</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">114/r</span>, <span class="Constant">78/N</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">110/n</span>, <span class="Constant">66/B</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">98/b</span>, <span class="Constant">81/Q</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">113/q</span>, <span class="Constant">75/K</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">107/k</span>, <span class="Constant">66/B</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">98/b</span>, <span class="Constant">78/N</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">110/n</span>, <span class="Constant">82/R</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">114/r</span> +<span id="L190" class="LineNr">190 </span> initial-position:&:@:char <span class="Special"><-</span> <a href='063array.mu.html#L16'>new-array</a> <span class="Constant">82/R</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">114/r</span>, <span class="Constant">78/N</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">110/n</span>, <span class="Constant">66/B</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">98/b</span>, <span class="Constant">81/Q</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">113/q</span>, <span class="Constant">75/K</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">107/k</span>, <span class="Constant">66/B</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">98/b</span>, <span class="Constant">78/N</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">110/n</span>, <span class="Constant">82/R</span>, <span class="Constant">80/P</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">32/blank</span>, <span class="Constant">112/p</span>, <span class="Constant">114/r</span> <span id="L191" class="LineNr">191 </span><span class="CommentedCode">#? 82/R, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 114/r,</span> <span id="L192" class="LineNr">192 </span><span class="CommentedCode">#? 78/N, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 110/n,</span> <span id="L193" class="LineNr">193 </span><span class="CommentedCode">#? 66/B, 80/P, 32/blank, 32/blank, 32/blank, 32/blank, 112/p, 98/b, </span> @@ -264,7 +264,7 @@ if ('onhashchange' in window) { <span id="L204" class="LineNr">204 </span> board:board <span class="Special"><-</span> initial-position <span id="L205" class="LineNr">205 </span> assume-screen <span class="Constant">30/width</span>, <span class="Constant">12/height</span> <span id="L206" class="LineNr">206 </span> run [ -<span id="L207" class="LineNr">207 </span> screen:&:screen <span class="Special"><-</span> print-board screen:&:screen, board +<span id="L207" class="LineNr">207 </span> <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span class="Special"><-</span> print-board <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, board <span id="L208" class="LineNr">208 </span> ] <span id="L209" class="LineNr">209 </span> screen-should-contain [ <span id="L210" class="LineNr">210 </span> <span class="Comment"># 012345678901234567890123456789</span> @@ -294,35 +294,35 @@ if ('onhashchange' in window) { <span id="L234" class="LineNr">234 </span>] <span id="L235" class="LineNr">235 </span> <span id="L236" class="LineNr">236 </span><span class="Comment"># prints only error messages to screen</span> -<span id="L237" class="LineNr">237 </span><span class="muRecipe">def</span> read-move stdin:&:source:char, screen:&:screen<span class="muRecipe"> -> </span>result:&:move, quit?:bool, error?:bool, stdin:&:source:char, screen:&:screen [ +<span id="L237" class="LineNr">237 </span><span class="muRecipe">def</span> read-move stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a><span class="muRecipe"> -> </span>result:&:move, quit?:bool, error?:bool, stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> [ <span id="L238" class="LineNr">238 </span> <span class="Constant">local-scope</span> <span id="L239" class="LineNr">239 </span> <span class="Constant">load-ingredients</span> -<span id="L240" class="LineNr">240 </span> from-file:num, quit?:bool, error?:bool <span class="Special"><-</span> read-file stdin, screen +<span id="L240" class="LineNr">240 </span> from-file:num, quit?:bool, error?:bool <span class="Special"><-</span> read-file stdin, <a href='081print.mu.html#L4'>screen</a> <span id="L241" class="LineNr">241 </span> <span class="muControl">return-if</span> quit?, <span class="Constant">0/dummy</span> <span id="L242" class="LineNr">242 </span> <span class="muControl">return-if</span> error?, <span class="Constant">0/dummy</span> <span id="L243" class="LineNr">243 </span> <span class="Comment"># construct the move object</span> <span id="L244" class="LineNr">244 </span> result:&:move <span class="Special"><-</span> new <span class="Constant">move:type</span> <span id="L245" class="LineNr">245 </span> *result <span class="Special"><-</span> put *result, <span class="Constant">from-file:offset</span>, from-file -<span id="L246" class="LineNr">246 </span> from-rank:num, quit?, error? <span class="Special"><-</span> read-rank stdin, screen +<span id="L246" class="LineNr">246 </span> from-rank:num, quit?, error? <span class="Special"><-</span> read-rank stdin, <a href='081print.mu.html#L4'>screen</a> <span id="L247" class="LineNr">247 </span> <span class="muControl">return-if</span> quit?, <span class="Constant">0/dummy</span> <span id="L248" class="LineNr">248 </span> <span class="muControl">return-if</span> error?, <span class="Constant">0/dummy</span> <span id="L249" class="LineNr">249 </span> *result <span class="Special"><-</span> put *result, <span class="Constant">from-rank:offset</span>, from-rank -<span id="L250" class="LineNr">250 </span> error? <span class="Special"><-</span> expect-from-channel stdin, <span class="Constant">45/dash</span>, screen +<span id="L250" class="LineNr">250 </span> error? <span class="Special"><-</span> expect-from-channel stdin, <span class="Constant">45/dash</span>, <a href='081print.mu.html#L4'>screen</a> <span id="L251" class="LineNr">251 </span> <span class="muControl">return-if</span> error?, <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span> -<span id="L252" class="LineNr">252 </span> to-file:num, quit?, error? <span class="Special"><-</span> read-file stdin, screen +<span id="L252" class="LineNr">252 </span> to-file:num, quit?, error? <span class="Special"><-</span> read-file stdin, <a href='081print.mu.html#L4'>screen</a> <span id="L253" class="LineNr">253 </span> <span class="muControl">return-if</span> quit?:bool, <span class="Constant">0/dummy</span> <span id="L254" class="LineNr">254 </span> <span class="muControl">return-if</span> error?:bool, <span class="Constant">0/dummy</span> <span id="L255" class="LineNr">255 </span> *result <span class="Special"><-</span> put *result, <span class="Constant">to-file:offset</span>, to-file -<span id="L256" class="LineNr">256 </span> to-rank:num, quit?, error? <span class="Special"><-</span> read-rank stdin, screen +<span id="L256" class="LineNr">256 </span> to-rank:num, quit?, error? <span class="Special"><-</span> read-rank stdin, <a href='081print.mu.html#L4'>screen</a> <span id="L257" class="LineNr">257 </span> <span class="muControl">return-if</span> quit?, <span class="Constant">0/dummy</span> <span id="L258" class="LineNr">258 </span> <span class="muControl">return-if</span> error?, <span class="Constant">0/dummy</span> <span id="L259" class="LineNr">259 </span> *result <span class="Special"><-</span> put *result, <span class="Constant">to-rank:offset</span>, to-rank -<span id="L260" class="LineNr">260 </span> error? <span class="Special"><-</span> expect-from-channel stdin, <span class="Constant">10/newline</span>, screen +<span id="L260" class="LineNr">260 </span> error? <span class="Special"><-</span> expect-from-channel stdin, <span class="Constant">10/newline</span>, <a href='081print.mu.html#L4'>screen</a> <span id="L261" class="LineNr">261 </span> <span class="muControl">return-if</span> error?, <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span> <span id="L262" class="LineNr">262 </span>] <span id="L263" class="LineNr">263 </span> <span id="L264" class="LineNr">264 </span><span class="Comment"># valid values for file: 0-7</span> -<span id="L265" class="LineNr">265 </span><span class="muRecipe">def</span> read-file stdin:&:source:char, screen:&:screen<span class="muRecipe"> -> </span>file:num, quit:bool, error:bool, stdin:&:source:char, screen:&:screen [ +<span id="L265" class="LineNr">265 </span><span class="muRecipe">def</span> read-file stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a><span class="muRecipe"> -> </span>file:num, quit:bool, error:bool, stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> [ <span id="L266" class="LineNr">266 </span> <span class="Constant">local-scope</span> <span id="L267" class="LineNr">267 </span> <span class="Constant">load-ingredients</span> <span id="L268" class="LineNr">268 </span> c:char, eof?:bool, stdin <span class="Special"><-</span> read stdin @@ -345,7 +345,7 @@ if ('onhashchange' in window) { <span id="L285" class="LineNr">285 </span> <span class="Delimiter">{</span> <span id="L286" class="LineNr">286 </span> newline?:bool <span class="Special"><-</span> equal c, <span class="Constant">10/newline</span> <span id="L287" class="LineNr">287 </span> <span class="muControl">break-unless</span> newline? -<span id="L288" class="LineNr">288 </span> print screen, <span class="Constant">[that's not enough]</span> +<span id="L288" class="LineNr">288 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[that's not enough]</span> <span id="L289" class="LineNr">289 </span> <span class="muControl">return</span> <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span>, <span class="Constant">1/error</span> <span id="L290" class="LineNr">290 </span> <span class="Delimiter">}</span> <span id="L291" class="LineNr">291 </span> file:num <span class="Special"><-</span> subtract c, <span class="Constant">97/a</span> @@ -353,23 +353,23 @@ if ('onhashchange' in window) { <span id="L293" class="LineNr">293 </span> <span class="Delimiter">{</span> <span id="L294" class="LineNr">294 </span> above-min:bool <span class="Special"><-</span> greater-or-equal file,<span class="Constant"> 0</span> <span id="L295" class="LineNr">295 </span> <span class="muControl">break-if</span> above-min -<span id="L296" class="LineNr">296 </span> print screen, <span class="Constant">[file too low: ]</span> -<span id="L297" class="LineNr">297 </span> print screen, c -<span id="L298" class="LineNr">298 </span> cursor-to-next-line screen +<span id="L296" class="LineNr">296 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[file too low: ]</span> +<span id="L297" class="LineNr">297 </span> print <a href='081print.mu.html#L4'>screen</a>, c +<span id="L298" class="LineNr">298 </span> <a href='081print.mu.html#L567'>cursor-to-next-line</a> <a href='081print.mu.html#L4'>screen</a> <span id="L299" class="LineNr">299 </span> <span class="muControl">return</span> <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span>, <span class="Constant">1/error</span> <span id="L300" class="LineNr">300 </span> <span class="Delimiter">}</span> <span id="L301" class="LineNr">301 </span> <span class="Delimiter">{</span> <span id="L302" class="LineNr">302 </span> below-max:bool <span class="Special"><-</span> lesser-than file,<span class="Constant"> 8</span> <span id="L303" class="LineNr">303 </span> <span class="muControl">break-if</span> below-max -<span id="L304" class="LineNr">304 </span> print screen, <span class="Constant">[file too high: ]</span> -<span id="L305" class="LineNr">305 </span> print screen, c +<span id="L304" class="LineNr">304 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[file too high: ]</span> +<span id="L305" class="LineNr">305 </span> print <a href='081print.mu.html#L4'>screen</a>, c <span id="L306" class="LineNr">306 </span> <span class="muControl">return</span> <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span>, <span class="Constant">1/error</span> <span id="L307" class="LineNr">307 </span> <span class="Delimiter">}</span> <span id="L308" class="LineNr">308 </span> <span class="muControl">return</span> file, <span class="Constant">0/quit</span>, <span class="Constant">0/error</span> <span id="L309" class="LineNr">309 </span>] <span id="L310" class="LineNr">310 </span> <span id="L311" class="LineNr">311 </span><span class="Comment"># valid values for rank: 0-7</span> -<span id="L312" class="LineNr">312 </span><span class="muRecipe">def</span> read-rank stdin:&:source:char, screen:&:screen<span class="muRecipe"> -> </span>rank:num, quit?:bool, error?:bool, stdin:&:source:char, screen:&:screen [ +<span id="L312" class="LineNr">312 </span><span class="muRecipe">def</span> read-rank stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a><span class="muRecipe"> -> </span>rank:num, quit?:bool, error?:bool, stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> [ <span id="L313" class="LineNr">313 </span> <span class="Constant">local-scope</span> <span id="L314" class="LineNr">314 </span> <span class="Constant">load-ingredients</span> <span id="L315" class="LineNr">315 </span> c:char, eof?:bool, stdin <span class="Special"><-</span> read stdin @@ -387,7 +387,7 @@ if ('onhashchange' in window) { <span id="L327" class="LineNr">327 </span> <span class="Delimiter">{</span> <span id="L328" class="LineNr">328 </span> newline?:bool <span class="Special"><-</span> equal c,<span class="Constant"> 10</span> <span class="Comment"># newline</span> <span id="L329" class="LineNr">329 </span> <span class="muControl">break-unless</span> newline? -<span id="L330" class="LineNr">330 </span> print screen, <span class="Constant">[that's not enough]</span> +<span id="L330" class="LineNr">330 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[that's not enough]</span> <span id="L331" class="LineNr">331 </span> <span class="muControl">return</span> <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span>, <span class="Constant">1/error</span> <span id="L332" class="LineNr">332 </span> <span class="Delimiter">}</span> <span id="L333" class="LineNr">333 </span> rank:num <span class="Special"><-</span> subtract c, <span class="Constant">49/'1'</span> @@ -395,15 +395,15 @@ if ('onhashchange' in window) { <span id="L335" class="LineNr">335 </span> <span class="Delimiter">{</span> <span id="L336" class="LineNr">336 </span> above-min:bool <span class="Special"><-</span> greater-or-equal rank,<span class="Constant"> 0</span> <span id="L337" class="LineNr">337 </span> <span class="muControl">break-if</span> above-min -<span id="L338" class="LineNr">338 </span> print screen, <span class="Constant">[rank too low: ]</span> -<span id="L339" class="LineNr">339 </span> print screen, c +<span id="L338" class="LineNr">338 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[rank too low: ]</span> +<span id="L339" class="LineNr">339 </span> print <a href='081print.mu.html#L4'>screen</a>, c <span id="L340" class="LineNr">340 </span> <span class="muControl">return</span> <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span>, <span class="Constant">1/error</span> <span id="L341" class="LineNr">341 </span> <span class="Delimiter">}</span> <span id="L342" class="LineNr">342 </span> <span class="Delimiter">{</span> <span id="L343" class="LineNr">343 </span> below-max:bool <span class="Special"><-</span> lesser-or-equal rank,<span class="Constant"> 7</span> <span id="L344" class="LineNr">344 </span> <span class="muControl">break-if</span> below-max -<span id="L345" class="LineNr">345 </span> print screen, <span class="Constant">[rank too high: ]</span> -<span id="L346" class="LineNr">346 </span> print screen, c +<span id="L345" class="LineNr">345 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[rank too high: ]</span> +<span id="L346" class="LineNr">346 </span> print <a href='081print.mu.html#L4'>screen</a>, c <span id="L347" class="LineNr">347 </span> <span class="muControl">return</span> <span class="Constant">0/dummy</span>, <span class="Constant">0/quit</span>, <span class="Constant">1/error</span> <span id="L348" class="LineNr">348 </span> <span class="Delimiter">}</span> <span id="L349" class="LineNr">349 </span> <span class="muControl">return</span> rank, <span class="Constant">0/quit</span>, <span class="Constant">0/error</span> @@ -411,7 +411,7 @@ if ('onhashchange' in window) { <span id="L351" class="LineNr">351 </span> <span id="L352" class="LineNr">352 </span><span class="Comment"># read a character from the given channel and check that it's what we expect</span> <span id="L353" class="LineNr">353 </span><span class="Comment"># return true on error</span> -<span id="L354" class="LineNr">354 </span><span class="muRecipe">def</span> expect-from-channel stdin:&:source:char, expected:char, screen:&:screen<span class="muRecipe"> -> </span>result:bool, stdin:&:source:char, screen:&:screen [ +<span id="L354" class="LineNr">354 </span><span class="muRecipe">def</span> expect-from-channel stdin:&:source:char, expected:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a><span class="muRecipe"> -> </span>result:bool, stdin:&:source:char, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> [ <span id="L355" class="LineNr">355 </span> <span class="Constant">local-scope</span> <span id="L356" class="LineNr">356 </span> <span class="Constant">load-ingredients</span> <span id="L357" class="LineNr">357 </span> c:char, eof?:bool, stdin <span class="Special"><-</span> read stdin @@ -419,7 +419,7 @@ if ('onhashchange' in window) { <span id="L359" class="LineNr">359 </span> <span class="Delimiter">{</span> <span id="L360" class="LineNr">360 </span> match?:bool <span class="Special"><-</span> equal c, expected <span id="L361" class="LineNr">361 </span> <span class="muControl">break-if</span> match? -<span id="L362" class="LineNr">362 </span> print screen, <span class="Constant">[expected character not found]</span> +<span id="L362" class="LineNr">362 </span> print <a href='081print.mu.html#L4'>screen</a>, <span class="Constant">[expected character not found]</span> <span id="L363" class="LineNr">363 </span> <span class="Delimiter">}</span> <span id="L364" class="LineNr">364 </span> result <span class="Special"><-</span> not match? <span id="L365" class="LineNr">365 </span>] @@ -427,8 +427,8 @@ if ('onhashchange' in window) { <span id="L367" class="LineNr">367 </span><span class="muScenario">scenario</span> read-move-blocking [ <span id="L368" class="LineNr">368 </span> <span class="Constant">local-scope</span> <span id="L369" class="LineNr">369 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> -<span id="L370" class="LineNr">370 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">2/capacity</span> -<span id="L371" class="LineNr">371 </span> read-move-routine:num/routine <span class="Special"><-</span> start-running read-move, source, screen:&:screen +<span id="L370" class="LineNr">370 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> +<span id="L371" class="LineNr">371 </span> read-move-routine:num/routine <span class="Special"><-</span> start-running read-move, source, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span id="L372" class="LineNr">372 </span> run [ <span id="L373" class="LineNr">373 </span> <span class="Comment"># 'read-move' is waiting for input</span> <span id="L374" class="LineNr">374 </span> wait-for-routine-to-block read-move-routine @@ -437,7 +437,7 @@ if ('onhashchange' in window) { <span id="L377" class="LineNr">377 </span> assert waiting?, <span class="Constant">[ </span> <span id="L378" class="LineNr">378 </span><span class="Constant">F read-move-blocking: routine failed to pause after coming up (before any keys were pressed)]</span> <span id="L379" class="LineNr">379 </span> <span class="Comment"># press 'a'</span> -<span id="L380" class="LineNr">380 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">97/a</span> +<span id="L380" class="LineNr">380 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">97/a</span> <span id="L381" class="LineNr">381 </span> restart read-move-routine <span id="L382" class="LineNr">382 </span> <span class="Comment"># 'read-move' still waiting for input</span> <span id="L383" class="LineNr">383 </span> wait-for-routine-to-block read-move-routine @@ -446,7 +446,7 @@ if ('onhashchange' in window) { <span id="L386" class="LineNr">386 </span> assert waiting?, <span class="Constant">[ </span> <span id="L387" class="LineNr">387 </span><span class="Constant">F read-move-blocking: routine failed to pause after rank 'a']</span> <span id="L388" class="LineNr">388 </span> <span class="Comment"># press '2'</span> -<span id="L389" class="LineNr">389 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">50/'2'</span> +<span id="L389" class="LineNr">389 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">50/'2'</span> <span id="L390" class="LineNr">390 </span> restart read-move-routine <span id="L391" class="LineNr">391 </span> <span class="Comment"># 'read-move' still waiting for input</span> <span id="L392" class="LineNr">392 </span> wait-for-routine-to-block read-move-routine @@ -455,7 +455,7 @@ if ('onhashchange' in window) { <span id="L395" class="LineNr">395 </span> assert waiting?, <span class="Constant">[ </span> <span id="L396" class="LineNr">396 </span><span class="Constant">F read-move-blocking: routine failed to pause after file 'a2']</span> <span id="L397" class="LineNr">397 </span> <span class="Comment"># press '-'</span> -<span id="L398" class="LineNr">398 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">45/'-'</span> +<span id="L398" class="LineNr">398 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">45/'-'</span> <span id="L399" class="LineNr">399 </span> restart read-move-routine <span id="L400" class="LineNr">400 </span> <span class="Comment"># 'read-move' still waiting for input</span> <span id="L401" class="LineNr">401 </span> wait-for-routine-to-block read-move-routine @@ -464,7 +464,7 @@ if ('onhashchange' in window) { <span id="L404" class="LineNr">404 </span> assert waiting?, <span class="Constant">[ </span> <span id="L405" class="LineNr">405 </span><span class="Constant">F read-move-blocking: routine failed to pause after hyphen 'a2-']</span> <span id="L406" class="LineNr">406 </span> <span class="Comment"># press 'a'</span> -<span id="L407" class="LineNr">407 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">97/a</span> +<span id="L407" class="LineNr">407 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">97/a</span> <span id="L408" class="LineNr">408 </span> restart read-move-routine <span id="L409" class="LineNr">409 </span> <span class="Comment"># 'read-move' still waiting for input</span> <span id="L410" class="LineNr">410 </span> wait-for-routine-to-block read-move-routine @@ -473,7 +473,7 @@ if ('onhashchange' in window) { <span id="L413" class="LineNr">413 </span> assert waiting?, <span class="Constant">[ </span> <span id="L414" class="LineNr">414 </span><span class="Constant">F read-move-blocking: routine failed to pause after rank 'a2-a']</span> <span id="L415" class="LineNr">415 </span> <span class="Comment"># press '4'</span> -<span id="L416" class="LineNr">416 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">52/'4'</span> +<span id="L416" class="LineNr">416 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">52/'4'</span> <span id="L417" class="LineNr">417 </span> restart read-move-routine <span id="L418" class="LineNr">418 </span> <span class="Comment"># 'read-move' still waiting for input</span> <span id="L419" class="LineNr">419 </span> wait-for-routine-to-block read-move-routine @@ -482,7 +482,7 @@ if ('onhashchange' in window) { <span id="L422" class="LineNr">422 </span> assert waiting?, <span class="Constant">[ </span> <span id="L423" class="LineNr">423 </span><span class="Constant">F read-move-blocking: routine failed to pause after file 'a2-a4']</span> <span id="L424" class="LineNr">424 </span> <span class="Comment"># press 'newline'</span> -<span id="L425" class="LineNr">425 </span> sink <span class="Special"><-</span> write sink,<span class="Constant"> 10</span> <span class="Comment"># newline</span> +<span id="L425" class="LineNr">425 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink,<span class="Constant"> 10</span> <span class="Comment"># newline</span> <span id="L426" class="LineNr">426 </span> restart read-move-routine <span id="L427" class="LineNr">427 </span> <span class="Comment"># 'read-move' now completes</span> <span id="L428" class="LineNr">428 </span> wait-for-routine-to-block read-move-routine @@ -500,8 +500,8 @@ if ('onhashchange' in window) { <span id="L440" class="LineNr">440 </span><span class="muScenario">scenario</span> read-move-quit [ <span id="L441" class="LineNr">441 </span> <span class="Constant">local-scope</span> <span id="L442" class="LineNr">442 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> -<span id="L443" class="LineNr">443 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">2/capacity</span> -<span id="L444" class="LineNr">444 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, screen:&:screen +<span id="L443" class="LineNr">443 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> +<span id="L444" class="LineNr">444 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span id="L445" class="LineNr">445 </span> run [ <span id="L446" class="LineNr">446 </span> <span class="Comment"># 'read-move' is waiting for input</span> <span id="L447" class="LineNr">447 </span> wait-for-routine-to-block read-move-routine @@ -510,7 +510,7 @@ if ('onhashchange' in window) { <span id="L450" class="LineNr">450 </span> assert waiting?, <span class="Constant">[ </span> <span id="L451" class="LineNr">451 </span><span class="Constant">F read-move-quit: routine failed to pause after coming up (before any keys were pressed)]</span> <span id="L452" class="LineNr">452 </span> <span class="Comment"># press 'q'</span> -<span id="L453" class="LineNr">453 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">113/q</span> +<span id="L453" class="LineNr">453 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">113/q</span> <span id="L454" class="LineNr">454 </span> restart read-move-routine <span id="L455" class="LineNr">455 </span> <span class="Comment"># 'read-move' completes</span> <span id="L456" class="LineNr">456 </span> wait-for-routine-to-block read-move-routine @@ -528,8 +528,8 @@ if ('onhashchange' in window) { <span id="L468" class="LineNr">468 </span><span class="muScenario">scenario</span> read-move-illegal-file [ <span id="L469" class="LineNr">469 </span> <span class="Constant">local-scope</span> <span id="L470" class="LineNr">470 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> -<span id="L471" class="LineNr">471 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">2/capacity</span> -<span id="L472" class="LineNr">472 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, screen:&:screen +<span id="L471" class="LineNr">471 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> +<span id="L472" class="LineNr">472 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span id="L473" class="LineNr">473 </span> run [ <span id="L474" class="LineNr">474 </span> <span class="Comment"># 'read-move' is waiting for input</span> <span id="L475" class="LineNr">475 </span> wait-for-routine-to-block read-move-routine @@ -537,7 +537,7 @@ if ('onhashchange' in window) { <span id="L477" class="LineNr">477 </span> waiting?:bool <span class="Special"><-</span> not-equal read-move-state, <span class="Constant">2/discontinued</span> <span id="L478" class="LineNr">478 </span> assert waiting?, <span class="Constant">[ </span> <span id="L479" class="LineNr">479 </span><span class="Constant">F read-move-illegal-file: routine failed to pause after coming up (before any keys were pressed)]</span> -<span id="L480" class="LineNr">480 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">50/'2'</span> +<span id="L480" class="LineNr">480 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">50/'2'</span> <span id="L481" class="LineNr">481 </span> restart read-move-routine <span id="L482" class="LineNr">482 </span> wait-for-routine-to-block read-move-routine <span id="L483" class="LineNr">483 </span> ] @@ -550,8 +550,8 @@ if ('onhashchange' in window) { <span id="L490" class="LineNr">490 </span><span class="muScenario">scenario</span> read-move-illegal-rank [ <span id="L491" class="LineNr">491 </span> <span class="Constant">local-scope</span> <span id="L492" class="LineNr">492 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> -<span id="L493" class="LineNr">493 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">2/capacity</span> -<span id="L494" class="LineNr">494 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, screen:&:screen +<span id="L493" class="LineNr">493 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> +<span id="L494" class="LineNr">494 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span id="L495" class="LineNr">495 </span> run [ <span id="L496" class="LineNr">496 </span> <span class="Comment"># 'read-move' is waiting for input</span> <span id="L497" class="LineNr">497 </span> wait-for-routine-to-block read-move-routine @@ -559,8 +559,8 @@ if ('onhashchange' in window) { <span id="L499" class="LineNr">499 </span> waiting?:bool <span class="Special"><-</span> not-equal read-move-state, <span class="Constant">2/discontinued</span> <span id="L500" class="LineNr">500 </span> assert waiting?, <span class="Constant">[ </span> <span id="L501" class="LineNr">501 </span><span class="Constant">F read-move-illegal-rank: routine failed to pause after coming up (before any keys were pressed)]</span> -<span id="L502" class="LineNr">502 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">97/a</span> -<span id="L503" class="LineNr">503 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">97/a</span> +<span id="L502" class="LineNr">502 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">97/a</span> +<span id="L503" class="LineNr">503 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">97/a</span> <span id="L504" class="LineNr">504 </span> restart read-move-routine <span id="L505" class="LineNr">505 </span> wait-for-routine-to-block read-move-routine <span id="L506" class="LineNr">506 </span> ] @@ -573,8 +573,8 @@ if ('onhashchange' in window) { <span id="L513" class="LineNr">513 </span><span class="muScenario">scenario</span> read-move-empty [ <span id="L514" class="LineNr">514 </span> <span class="Constant">local-scope</span> <span id="L515" class="LineNr">515 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> -<span id="L516" class="LineNr">516 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> new-channel <span class="Constant">2/capacity</span> -<span id="L517" class="LineNr">517 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, screen:&:screen +<span id="L516" class="LineNr">516 </span> source:&:source:char, sink:&:sink:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> +<span id="L517" class="LineNr">517 </span> read-move-routine:num <span class="Special"><-</span> start-running read-move, source, <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span id="L518" class="LineNr">518 </span> run [ <span id="L519" class="LineNr">519 </span> <span class="Comment"># 'read-move' is waiting for input</span> <span id="L520" class="LineNr">520 </span> wait-for-routine-to-block read-move-routine @@ -582,8 +582,8 @@ if ('onhashchange' in window) { <span id="L522" class="LineNr">522 </span> waiting?:bool <span class="Special"><-</span> not-equal read-move-state, <span class="Constant">2/discontinued</span> <span id="L523" class="LineNr">523 </span> assert waiting?, <span class="Constant">[ </span> <span id="L524" class="LineNr">524 </span><span class="Constant">F read-move-empty: routine failed to pause after coming up (before any keys were pressed)]</span> -<span id="L525" class="LineNr">525 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">10/newline</span> -<span id="L526" class="LineNr">526 </span> sink <span class="Special"><-</span> write sink, <span class="Constant">97/a</span> +<span id="L525" class="LineNr">525 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">10/newline</span> +<span id="L526" class="LineNr">526 </span> sink <span class="Special"><-</span> <a href='075channel.mu.html#L66'>write</a> sink, <span class="Constant">97/a</span> <span id="L527" class="LineNr">527 </span> restart read-move-routine <span id="L528" class="LineNr">528 </span> wait-for-routine-to-block read-move-routine <span id="L529" class="LineNr">529 </span> ] @@ -615,7 +615,7 @@ if ('onhashchange' in window) { <span id="L555" class="LineNr">555 </span> *move <span class="Special"><-</span> merge <span class="Constant">6/g</span>, <span class="Constant">1/'2'</span>, <span class="Constant">6/g</span>, <span class="Constant">3/'4'</span> <span id="L556" class="LineNr">556 </span> run [ <span id="L557" class="LineNr">557 </span> board <span class="Special"><-</span> make-move board, move -<span id="L558" class="LineNr">558 </span> screen:&:screen <span class="Special"><-</span> print-board screen:&:screen, board +<span id="L558" class="LineNr">558 </span> <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a> <span class="Special"><-</span> print-board <a href='081print.mu.html#L4'>screen</a>:&:<a href='081print.mu.html#L4'>screen</a>, board <span id="L559" class="LineNr">559 </span> ] <span id="L560" class="LineNr">560 </span> screen-should-contain [ <span id="L561" class="LineNr">561 </span> <span class="Comment"># 012345678901234567890123456789</span> |