Anonymous user
Solve a Hidato puzzle: Difference between revisions
m
→{{header|Tailspin}}: syntax update
Thundergnat (talk | contribs) (→{{header|Raku}}: Fix up internal links) |
m (→{{header|Tailspin}}: syntax update) |
||
Line 4,062:
templates solve
when <~{row: <1..$@hidato.board::length>, col: <1..$@hidato.board(1)::length>}> do !VOID
when <{ n: <=$@hidato.given(
when <?($@hidato.board($.row; $.col) <~=0|=$.n>)> do !VOID
when <?($@hidato.board($.row; $.col) <=0>)?($@hidato.given($.next) <=$.n>)> do !VOID
def guess: $;
def back: $@hidato.board($.row; $.col);
def next: $ -> \(when <{n: <=$back>}> do $.next + 1!
@hidato.board($.row; $.col): $.n;
0..8 -> { next: $next, n: $guess.n + 1, row: $guess.row + $ ~/ 3 - 1, col: $guess.col + $ mod 3 - 1 } -> #
Line 4,079:
end hidato
$input -> hidato -> '$... -> '$... -> ' $ -> \(when <=-1> do ' .' ! when <10..> do '$;' !
';
' ->!OUT::write
|