Stepping

Hi there

10.times do
  puts "hi"
end

is there a way to stepping this? Something like

(10.times).step(2)

I know this does not work…

thx.

See Steppable - Crystal 1.1.1.

1 Like

Ah, coming soon… interesting.

Is this what you are looking for?

0.step(to: 9, by: 2) do |i|
  puts "hi: #{i}"
end
2 Likes

Yes… that works the way i need.
thx.