Solve hanging lantern problem: Difference between revisions

Content added Content deleted
(→‎{{header|Commodore BASIC}}: Add implementation.)
(→‎{{header|Raku}}: Ena me syntaxes highlighting. The highlighter name is not necessarily the language name.)
Line 420: Line 420:
Rather than take the number of columns as an explicit argument, this program infers the number from the size of the array of columns passed in. Also, the verbose output (optional task) gives the sequence of column numbers from which to take the bottommost lantern at each step, rather than numbering each lantern individually.
Rather than take the number of columns as an explicit argument, this program infers the number from the size of the array of columns passed in. Also, the verbose output (optional task) gives the sequence of column numbers from which to take the bottommost lantern at each step, rather than numbering each lantern individually.


<lang raku>unit sub MAIN(*@columns, :v(:$verbose)=False);
<lang perl6>unit sub MAIN(*@columns, :v(:$verbose)=False);


my @sequences = @columns
my @sequences = @columns