Sha256: 40435de92f6e67ab13ffe7fd45765e794a1042ec16de19d7011969af7757c73a

Contents?: true

Size: 257 Bytes

Versions: 11

Compression:

Stored size: 257 Bytes

Contents

# section_5/part_2/answer.rb
# 5-3-loop.rb
names = %w[tanaka nakamura sasaki suzuki]
index = 0

names.size.times do
  puts names[index]
  index += 1
end
# add your code.
index = 0

loop do
  puts names[index]
  index += 1
  break if index >= names.size
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby_learner-1.2.9 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.8 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.7 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.6 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.5 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.4 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.3 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.2 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.1 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.2.0 contents/questions/sequential_check/section_5/part_3/lib/answer.rb
ruby_learner-1.1.15 questions/sequential_check/section_5/part_3/lib/answer.rb