Anonymous user
Solve the no connection puzzle: Difference between revisions
m
→unannotated solutions: added/changed comments and whitespace.
m (→unannotated solutions: fixed typos.) |
m (→unannotated solutions: added/changed comments and whitespace.) |
||
Line 1,387:
subs=subs + 1; !._.subs=__
end /*#*/
!._.0=subs /*assign the number of the node paths.
end /*nodes*/
pegs=nodes-1 /*the number of pegs to be seated.
_=' ' /*_ is used for indenting the output.
do a=1 for pegs; if ?('A') then iterate
do b=1 for pegs; if ?('B') then iterate
Line 1,409:
end /*b*/
end /*a*/
say /*display a blank line to the
s=left('s',cnt\==1) /*handle the case of plurals (or not).
say 'found ' cnt " solution"s'.' /*display the number of solutions found
exit /*stick a fork in it, we're all done.
/*──────────────────────────────────────────────────────────────────────────────────────*/
?: parse arg node; nn=value(node)
|