summary refs log blame commit diff stats
path: root/compiler/commands.nim
blob: 3874ea38fbd076fced3f39ba83282ccb5a56aeb8 (plain) (tree)
class="muScenario">scenario</span> read-move-empty [ <span id="L512" class="LineNr">512 </span> <span class="Constant">local-scope</span> <span id="L513" class="LineNr">513 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> <span id="L514" class="LineNr">514 </span> <a href='075channel.mu.html#L36'>source</a>:&amp;:<a href='075channel.mu.html#L36'>source</a>:char, <a href='075channel.mu.html#L40'>sink</a>:&amp;:<a href='075channel.mu.html#L40'>sink</a>:char <span class="Special">&lt;-</span> <a href='075channel.mu.html#L44'>new-channel</a> <span class="Constant">2/capacity</span> <span id="L515" class="LineNr">515 </span> read-move-routine:num <span class="Special">&lt;-</span> <span class="muControl">start-running</span> <a href='chessboard.mu.html#L248'>read-move</a>, <a href='075channel.mu.html#L36'>source</a>, <a href='081print.mu.html#L16'>screen</a> <span id="L516" class="LineNr">516 </span> run [ <span id="L517" class="LineNr">517 </span> <span class="Comment"># 'read-move' is waiting for keypress</span> <span id="L518" class="LineNr">518 </span> wait-for-routine-to-block read-move-routine <span id="L519" class="LineNr">519 </span> read-move-state:num <span class="Special">&lt;-</span> routine-state read-move-routine <span id="L520" class="LineNr">520 </span> waiting?:bool <span class="Special">&lt;-</span> not-equal read-move-state, <span class="Constant">2/discontinued</span> <span id="L521" class="LineNr">521 </span> assert waiting?, <span class="Constant">[ </span> <span id="L522" class="LineNr">522 </span><span class="Constant">F read-move-empty: routine failed to pause after coming up (before any keys were pressed)]</span> <span id="L523" class="LineNr">523 </span> <a href='075channel.mu.html#L40'>sink</a> <span class="Special">&lt;-</span> <a href='075channel.mu.html#L60'>write</a> <a href='075channel.mu.html#L40'>sink</a>, <span class="Constant">10/newline</span> <span id="L524" class="LineNr">524 </span> <a href='075channel.mu.html#L40'>sink</a> <span class="Special">&lt;-</span> <a href='075channel.mu.html#L60'>write</a> <a href='075channel.mu.html#L40'>sink</a>, <span class="Constant">97/a</span> <span id="L525" class="LineNr">525 </span> restart read-move-routine <span id="L526" class="LineNr">526 </span> wait-for-routine-to-block read-move-routine <span id="L527" class="LineNr">527 </span> ] <span id="L528" class="LineNr">528 </span> screen-should-contain [ <span id="L529" class="LineNr">529 </span> <span class="Constant"> .that's not enough .</span> <span id="L530" class="LineNr">530 </span> <span class="Constant"> . .</span> <span id="L531" class="LineNr">531 </span> ] <span id="L532" class="LineNr">532 </span>] <span id="L533" class="LineNr">533 </span> <span id="L534" class="LineNr">534 </span><span class="muRecipe">def</span> <a href='chessboard.mu.html#L534'>make-move</a> <a href='chessboard.mu.html#L67'>board</a>:<a href='chessboard.mu.html#L67'>board</a>, m:&amp;:<a href='chessboard.mu.html#L239'>move</a><span class="muRecipe"> -&gt; </span><a href='chessboard.mu.html#L67'>board</a>:<a href='chessboard.mu.html#L67'>board</a> [ <span id="L535" class="LineNr">535 </span> <span class="Constant">local-scope</span> <span id="L536" class="LineNr">536 </span> <span class="Constant">load-inputs</span> <span id="L537" class="LineNr">537 </span> from-file:num <span class="Special">&lt;-</span> get *m, <span class="Constant">from-file:offset</span> <span id="L538" class="LineNr">538 </span> from-rank:num <span class="Special">&lt;-</span> get *m, <span class="Constant">from-rank:offset</span> <span id="L539" class="LineNr">539 </span> to-file:num <span class="Special">&lt;-</span> get *m, <span class="Constant">to-file:offset</span> <span id="L540" class="LineNr">540 </span> to-rank:num <span class="Special">&lt;-</span> get *m, <span class="Constant">to-rank:offset</span> <span id="L541" class="LineNr">541 </span> from-f:&amp;:@:char <span class="Special">&lt;-</span> index *board, from-file <span id="L542" class="LineNr">542 </span> to-f:&amp;:@:char <span class="Special">&lt;-</span> index *board, to-file <span id="L543" class="LineNr">543 </span> src:char/square <span class="Special">&lt;-</span> index *from-f, from-rank <span id="L544" class="LineNr">544 </span> *to-f <span class="Special">&lt;-</span> put-index *to-f, to-rank, src <span id="L545" class="LineNr">545 </span> *from-f <span class="Special">&lt;-</span> put-index *from-f, from-rank, <span class="Constant">32/space</span> <span id="L546" class="LineNr">546 </span>] <span id="L547" class="LineNr">547 </span> <span id="L548" class="LineNr">548 </span><span class="muScenario">scenario</span> making-a-move [ <span id="L549" class="LineNr">549 </span> <span class="Constant">local-scope</span> <span id="L550" class="LineNr">550 </span> assume-screen <span class="Constant">30/width</span>, <span class="Constant">12/height</span> <span id="L551" class="LineNr">551 </span> <a href='chessboard.mu.html#L67'>board</a>:<a href='chessboard.mu.html#L67'>board</a> <span class="Special">&lt;-</span> <a href='chessboard.mu.html#L190'>initial-position</a> <span id="L552" class="LineNr">552 </span> <a href='chessboard.mu.html#L239'>move</a>:&amp;:<a href='chessboard.mu.html#L239'>move</a> <span class="Special">&lt;-</span> new <span class="Constant"><a href='chessboard.mu.html#L239'>move</a>:type</span> <span id="L553" class="LineNr">553 </span> *move <span class="Special">&lt;-</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="L554" class="LineNr">554 </span> run [ <span id="L555" class="LineNr">555 </span> <a href='chessboard.mu.html#L67'>board</a> <span class="Special">&lt;-</span> <a href='chessboard.mu.html#L534'>make-move</a> <a href='chessboard.mu.html#L67'>board</a>, <a href='chessboard.mu.html#L239'>move</a> <span id="L556" class="LineNr">556 </span> <a href='081print.mu.html#L16'>screen</a> <span class="Special">&lt;-</span> print <a href='081print.mu.html#L16'>screen</a>, <a href='chessboard.mu.html#L67'>board</a> <span id="L557" class="LineNr">557 </span> ] <span id="L558" class="LineNr">558 </span> screen-should-contain [ <span id="L559" class="LineNr">559 </span> <span class="Comment"># 012345678901234567890123456789</span> <span id="L560" class="LineNr">560 </span> <span class="Constant"> .8 | r n b q k b n r .</span> <span id="L561" class="LineNr">561 </span> <span class="Constant"> .7 | p p p p p p p p .</span> <span id="L562" class="LineNr">562 </span> <span class="Constant"> .6 | .</span> <span id="L563" class="LineNr">563 </span> <span class="Constant"> .5 | .</span> <span id="L564" class="LineNr">564 </span> <span class="Constant"> .4 | P .</span> <span id="L565" class="LineNr">565 </span> <span class="Constant"> .3 | .</span> <span id="L566" class="LineNr">566 </span> <span class="Constant"> .2 | P P P P P P P .</span> <span id="L567" class="LineNr">567 </span> <span class="Constant"> .1 | R N B Q K B N R .</span> <span id="L568" class="LineNr">568 </span> <span class="Constant"> . +---------------- .</span> <span id="L569" class="LineNr">569 </span> <span class="Constant"> . a b c d e f g h .</span> <span id="L570" class="LineNr">570 </span> <span class="Constant"> . .</span> <span id="L571" class="LineNr">571 </span> ] <span id="L572" class="LineNr">572 </span>] </pre> </body> </html> <!-- vim: set foldmethod=manual : -->