A simple loop in Ruby
1 2 i = 0 3 10.times do 4 i += 1 5 puts i 6 end
DZone Snippets > jrobertson > loop
12731 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
James Robertson http://www.r0bertson.co.uk
1 2 i = 0 3 10.times do 4 i += 1 5 puts i 6 end