Created
September 27, 2013 12:50
-
-
Save mecampbellsoup/6728102 to your computer and use it in GitHub Desktop.
Speaker greeting method
This file contains hidden or 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
| 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