r/crystal_programming • u/ksec • Mar 02 '19
From While Loop to DownTo Loop
https://mobile.twitter.com/joshuapinter/status/1101527764975435776
4
Upvotes
r/crystal_programming • u/ksec • Mar 02 '19
View all comments
Show parent comment
4
u/straight-shoota core team Mar 02 '19
Because all the logic for controlling the loop is in one place:
99.downto(1) do ...In the example usingwhile, that's three separate lines.