Flipping bits game: Difference between revisions
m
→{{header|Perl 6}}: fixed scramble routine
(Added a link to MapleCloud) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: fixed scramble routine) |
||
Line 2,211:
=={{header|Perl 6}}==
{{Works with|rakudo|2016.11}}
Pass in a parameter to set the square size for the puzzle. (Defaults to 4.) Arbitrarily limited to between 1 and 26. Yes, you can choose to solve a 1 element square puzzle, but it won't be very challenging. Accepts upper or lower case letters for columns. Disregards any out-of-range indices. Enter a blank or 0 (zero) to exit.
Line 2,264 ⟶ 2,265:
sub scramble(%hash) {
my @keys = keys %hash;
@keys.push:
flip $_, %hash for @keys.pick( @keys/2 );
}</lang>
|