Created
September 27, 2013 03:46
-
-
Save polycarpou/6723842 to your computer and use it in GitHub Desktop.
week1 day4 homework badges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_badge(name) | |
"Hello, my name is #{name}." | |
end | |
#puts print_badge("Michael") | |
speakers = "Edsger, Ada, Charles, Alan, Grace, Linus, Matz" | |
speakers = speakers.split(", ") | |
#p speakers | |
def print_badges(speakers) | |
arr = [] | |
speakers.each do |x| | |
arr << "Hello, my name is #{x}." | |
end | |
arr | |
end | |
#p print_badges(speakers) | |
def print_badges_rooms(speakers) | |
arr = [] | |
room = 1 | |
speakers.each do |x| | |
arr << "Hello #{x}! You'll be assigned to room #{room}." | |
room +=1 | |
end | |
arr | |
end | |
#p print_badges_rooms(speakers) | |
def printing(speakers) | |
print_badges_rooms(speakers).each do |x| | |
puts x | |
end | |
puts print_badges(speakers) | |
end | |
printing(speakers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment