Loops/Wrong ranges: Difference between revisions

m
(→‎{{header|zkl}}: added zode)
m (→‎{{header|zkl}}: show errors)
Line 430:
fcn looper([(start,stop,increment)]){
print(" %3s %3s\t%2d --> ".fmt(start,stop,increment));
if(increment!=0)try{ foreach n in ([start..stop,increment]){ print(n," ") } }
catch{ print(__exception) }
println();
}
Line 442 ⟶ 443:
start stop increment
-2 2 1 --> -2 -1 0 1 2
-2 2 0 --> ValueError(range: step == 0)
-2 2 -1 -->
-2 2 10 --> -2
Line 448 ⟶ 449:
2 2 1 --> 2
2 2 -1 --> 2
2 2 0 --> ValueError(range: step == 0)
0 0 0 --> ValueError(range: step == 0)
0 3.14159 0 --> 0 0.785398 1.5708 2.35619 3.14159
a e 1 --> a b c d e
Anonymous user