Skip to content

Commit

Permalink
loop files added
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthikeyan A K committed Oct 19, 2013
1 parent 28dd4c7 commit 41afadd
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
8 changes: 8 additions & 0 deletions break_at_10.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# break_at_10.rb

i = 1
loop do
puts i
break if i == 10
i = i+1
end
6 changes: 6 additions & 0 deletions loop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# loop.rb

loop do
puts "I Love Ruby"
end

9 changes: 9 additions & 0 deletions no_13.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# no_13.rb

i = 0
loop do
i = i + 1
next if i == 13
puts i
break if i == 20
end
9 changes: 9 additions & 0 deletions no_13_a.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# no_13.rb

i = 0
loop do
next if i == 13
puts i
break if i == 20
i = i + 1
end
11 changes: 11 additions & 0 deletions telling_mom.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# telling_mom.rb

i = 1
loop do
puts i
break if i == 10
i = i+1
end

puts "Mom I have finished printing 10"

0 comments on commit 41afadd

Please sign in to comment.