Skip to content

Instantly share code, notes, and snippets.

@ddd1600
Created June 11, 2012 17:43
Show Gist options
  • Save ddd1600/2911525 to your computer and use it in GitHub Desktop.
Save ddd1600/2911525 to your computer and use it in GitHub Desktop.
rps console -- human vs human
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