Created
June 11, 2012 17:43
-
-
Save ddd1600/2911525 to your computer and use it in GitHub Desktop.
rps console -- human vs human
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
require("./rps.rb") | |
class DoGame | |
def promptuser | |
loop do | |
$stdout.write("Player 1: ") | |
param1 = $stdin.gets.chomp | |
param1 = param1.to_sym | |
break if param1 == :quit | |
$stdout.write("Player 2: ") | |
param2 = $stdin.gets.chomp | |
param2 = param2.to_sym | |
break if param2 == :quit | |
rps9 = RockPaperScissors.new | |
rps9.play(param1, param2) | |
end | |
end | |
end | |
g = DoGame.new | |
g.promptuser |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment