Solve hanging lantern problem: Difference between revisions
Content added Content deleted
(Added Uiua solution) |
(Added Quackery.) |
||
Line 1,280: | Line 1,280: | ||
for x in seq([1, 2, 3]): |
for x in seq([1, 2, 3]): |
||
print(x)</syntaxhighlight> |
print(x)</syntaxhighlight> |
||
=={{header|Quackery}}== |
|||
<syntaxhighlight lang="Quackery"> [ 1 swap times [ i 1+ * ] ] is ! ( n --> n ) |
|||
[ 0 over witheach + ! |
|||
1 rot witheach [ ! * ] |
|||
/ ] is solve ( [ --> n ) |
|||
[ [] |
|||
$ "Number of columns? " |
|||
input quackery times |
|||
[ $ "How many lanterns? " |
|||
input quackery join ] |
|||
solve |
|||
say "Removal sequences: " |
|||
echo ] is task ( --> )</syntaxhighlight> |
|||
{{out}} |
|||
<pre>Number of columns? 8 |
|||
How many lanterns? 1 |
|||
How many lanterns? 2 |
|||
How many lanterns? 3 |
|||
How many lanterns? 4 |
|||
How many lanterns? 5 |
|||
How many lanterns? 6 |
|||
How many lanterns? 7 |
|||
How many lanterns? 8 |
|||
Removal sequences: 73566121315513295589120000 |
|||
</pre> |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |