Loops/Wrong ranges: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl 6}}: at this point I'm just screwin' around.)
m (→‎{{header|Perl 6}}: meh, use defined instead of boolean true)
Line 289: Line 289:
printf "Start: %3s, Stop: %3s, Increment: %3s | ", $start, $stop.Str, $inc;
printf "Start: %3s, Stop: %3s, Increment: %3s | ", $start, $stop.Str, $inc;
# only show up to the first 15 elements of possibly infinite sequences
# only show up to the first 15 elements of possibly infinite sequences
put $seq[^15].grep: +*.so
put $seq[^15].grep: +*.defined
}
}


Line 313: Line 313:
Start: 2, Stop: 2, Increment: 1 | 2
Start: 2, Stop: 2, Increment: 1 | 2
Start: 2, Stop: 2, Increment: 0 | 2
Start: 2, Stop: 2, Increment: 0 | 2
Start: 0, Stop: 0, Increment: 0 |
Start: 0, Stop: 0, Increment: 0 | 0
Start: 1, Stop: Inf, Increment: 3 | 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43
Start: 1, Stop: Inf, Increment: 3 | 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43
Start: 1, Stop: 2, Increment: 0 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Start: 1, Stop: 2, Increment: 0 | 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1