learning-perl6/ch2/ex2-9.raku

11 lines
166 B
Raku

# Write a looping program to output a customizable multiple
sub MAIN ($multiple=3) {
loop {
state $sum = 0;
say $sum;
$sum += $multiple;
last if $sum > 20;
}
}