hi

Ruby code posted by mp
created at 27 Dec 12:39

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def badge_maker(name)
   return "Hello, my name is #{name}."
end

def batch_badge_creator(array)
   array.map do |e|
      badge_maker(e)
   end
end

def assign_rooms(array)
   room_assignments = []
   array.each_with_index do |e,i|
      room_assignments << "Hello, #{e}! You'll be assigned to room #{i+1}!"
   end
   return room_assignments
end

def printer(array)
   batch_badge_creator(array).each do |e|
      puts "#{e}"
   end
   assign_rooms(array).each do |i|
      puts "#{i}"
   end
end
524 Bytes in 5 ms with coderay