First class environments: Difference between revisions
m
→{{header|Perl 6}}: two changes to make it run again
m (Added Sidef) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: two changes to make it run again) |
||
Line 696:
=={{header|Perl 6}}==
{{Works with|rakudo|2015-12-17}}
Fairly straightforward. Set up an array of hashes containing the current values and iteration counts then pass each hash in turn with a code reference to a routine to calculate the next iteration.
Line 702 ⟶ 703:
};
sub next (%this
return %this if %this.<value> == 1;
%this.<value>.=&get_next;
Line 709 ⟶ 710:
};
my @hailstones = map {
while not all( map { $_.<value> }, @hailstones ) == 1 {
|