Skip to content

Instantly share code, notes, and snippets.

@mecampbellsoup
Created September 27, 2013 12:50
Show Gist options
  • Select an option

  • Save mecampbellsoup/6728102 to your computer and use it in GitHub Desktop.

Select an option

Save mecampbellsoup/6728102 to your computer and use it in GitHub Desktop.
Speaker greeting method
names = %w(Edsger Ada Charles Alan Grace Linus Matz)
rooms = %w(1 2 3 4 5 6 7)
def say_speaker_greeting(name, name_list, room_list)
i = name_list.index(name)
#"Hello, (name)! You'll be assigned to room (room)!"
# set room assignments... could do it randomly using sample
puts "Hello, #{name}! You'll be assigned to room #{room_list[i]}!"
end
say_speaker_greeting("Ada", names, rooms)
say_speaker_greeting("Linus", names, rooms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment