Class: Kaibaibo::CompPlayer
Instance Attribute Summary
Attributes inherited from Player
Instance Method Summary collapse
- #gather_choice ⇒ Object
-
#initialize ⇒ CompPlayer
constructor
A new instance of CompPlayer.
Methods inherited from Player
Constructor Details
#initialize ⇒ CompPlayer
Returns a new instance of CompPlayer.
4 5 6 |
# File 'lib/kaibaibo/compplayer.rb', line 4 def initialize super("computer") end |
Instance Method Details
#gather_choice ⇒ Object
8 9 10 11 |
# File 'lib/kaibaibo/compplayer.rb', line 8 def gather_choice choices = [:rock, :paper, :scissors] throw(choices[rand(3)]) end |