Skip to content

Instantly share code, notes, and snippets.

@jmoon90
Created November 27, 2013 15:13
Show Gist options
  • Select an option

  • Save jmoon90/7677318 to your computer and use it in GitHub Desktop.

Select an option

Save jmoon90/7677318 to your computer and use it in GitHub Desktop.
# 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