A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
15
Task/Loops-Nested/Ruby/loops-nested.rb
Normal file
15
Task/Loops-Nested/Ruby/loops-nested.rb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
srand
|
||||
ary = (1..20).to_a.shuffle.each_slice(4).to_a
|
||||
p ary
|
||||
|
||||
catch :found_it do
|
||||
for row in ary
|
||||
for element in row
|
||||
print "%2d " % element
|
||||
throw :found_it if element == 20
|
||||
end
|
||||
puts ","
|
||||
end
|
||||
end
|
||||
|
||||
puts "done"
|
||||
Loading…
Add table
Add a link
Reference in a new issue