Skip to content

Instantly share code, notes, and snippets.

@rosiehoyem
Last active December 24, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosiehoyem/6728360 to your computer and use it in GitHub Desktop.
Save rosiehoyem/6728360 to your computer and use it in GitHub Desktop.
Ruby homework, day 4
=begin
1. print phrases with names
2. create array with phrases
3. assign rooms to speakers
4. create another array with speaker welcome
=end
# "Hello, my name is _____."
name = ["Edsger", "Ada", "Charles", "Alan", "Grace", "Linus", "Matz"]
rooms = [1, 2, 3, 4, 5, 6, 7]
def badges(name)
badge_list = []
name.each do |x|
badge_list << "Hello, my name is #{x}."
end
badge_list
end
def schedule(name)
rm = 1
room_assignments = []
name.each do |x|
room_assignments << "Hello, #{x}! You will be assigned to room #{rm}!"
rm += 1
end
room_assignments
end
badge_lables = badges(name)
schedules = schedule(name)
def prints-things
puts badge_lables
puts schedules
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment