learning-perl6/ch2/ex2-9.raku

11 lines
166 B
Raku
Raw Normal View History

2023-11-12 03:03:05 +00:00
# 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;
}
}