Solve a Hidato puzzle: Difference between revisions

→‎{{header|Tailspin}}: Clearer types (required thanks to autotyping)
(→‎{{header|Tailspin}}: Clearer types (required thanks to autotyping))
Line 4,711:
templates hidato
composer setup
@:data givenInput <[<={}|{row: 1<row>, col: 1, given:[]<col>};>*]> local
@: {row: 1, col: 1, givenInput:[]};
{ board: [ <line>+ ], given: $@.givengivenInput -> \[i](<~={}> { n: $i, $...} !\) }
rule line: [ <cell>+ ] (<'\n '>?) (..|@: {row: $@.row + 1, col: 1};)
rule cell: <open|blocked|given> (<' '>?) (@.col: $@.col + 1;)
Line 4,718 ⟶ 4,719:
rule blocked: <' \.'> -> -1
rule given: (<' '>?) (def given: <INT>;)
($given -> ..|@.givengivenInput: $@.givengivenInput::length+1..$ -> []{};)
($given -> @.givengivenInput($): { row: $@.row, col: $@.col };)
$given
end setup
Anonymous user