Class: VikingRoom7::Computer

Inherits:
Player
  • Object
show all
Defined in:
lib/viking_room7/computer.rb

Instance Attribute Summary

Attributes inherited from Player

#hand, #name

Instance Method Summary collapse

Methods inherited from Player

#throw

Constructor Details

#initializeComputer

Returns a new instance of Computer.



4
5
6
# File 'lib/viking_room7/computer.rb', line 4

def initialize
  super("computer")
end

Instance Method Details

#get_handObject



8
9
10
11
# File 'lib/viking_room7/computer.rb', line 8

def get_hand
  hand = ["r", 'p', 's'].sample
  @hand = hand
end