RosettaCodeData/Task/Loops-For-with-a-specified-step/E/loops-for-with-a-specified-step-2.e
2023-07-01 13:44:08 -04:00

17 lines
314 B
Text

def stepRange(low, high, step) {
def range {
to iterate(f) {
var i := low
while (i <= high) {
f(null, i)
i += step
}
}
}
return range
}
for i in stepRange(2, 9, 2) {
print(`$i, `)
}
println("who do we appreciate?")