Created
November 27, 2013 15:13
-
-
Save jmoon90/7677318 to your computer and use it in GitHub Desktop.
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
| # Implement your solution here. You may reference any additional files from here as well. | |
| def phase_2 | |
| puts "What was team 1's name?" | |
| team1 = gets.chomp | |
| puts "What was team 1's score?" | |
| t1score = gets.chomp.to_i | |
| puts "What was team 2's name?" | |
| team2 = gets.chomp | |
| puts "What was team 2's score?" | |
| t2score = gets.chomp.to_i | |
| puts "#{team1} is the victor!" if t1score > t2score | |
| puts "#{team2} is the victor!" if t2score > t1score | |
| end | |
| def repeat | |
| phase_2 | |
| puts "Would you like to provide another game? (Y/N)" | |
| answer = gets.chomp | |
| while answer != "N" | |
| phase_2 | |
| puts "Would you like to provide another game? (Y/N)" | |
| answer = gets.chomp | |
| end | |
| end | |
| repeat | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment