Class: Rpsshoot::Computer
Overview
Computer class manages AI player in one player mode
Instance Attribute Summary
Attributes inherited from Player
Instance Method Summary collapse
-
#initialize(symbol, name) ⇒ Computer
constructor
A new instance of Computer.
-
#shoot ⇒ Object
Computer takes a turn.
Constructor Details
#initialize(symbol, name) ⇒ Computer
Returns a new instance of Computer.
33 34 35 |
# File 'lib/rpsshoot/player.rb', line 33 def initialize(symbol, name) super end |
Instance Method Details
#shoot ⇒ Object
Computer takes a turn
38 39 40 41 |
# File 'lib/rpsshoot/player.rb', line 38 def shoot = ["rock", "paper", "scissors"] shoot = .sample end |