Class: TresRaya::Player
- Inherits:
-
Object
- Object
- TresRaya::Player
- Defined in:
- lib/tres_raya/player.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mark ⇒ Object
readonly
Returns the value of attribute mark.
Instance Method Summary collapse
- #finish(final_board) ⇒ Object
-
#initialize(mark) ⇒ Player
constructor
A new instance of Player.
- #move(board) ⇒ Object
Constructor Details
#initialize(mark) ⇒ Player
Returns a new instance of Player.
3 4 5 |
# File 'lib/tres_raya/player.rb', line 3 def initialize( mark ) @mark = mark # "X" or "O" or " " end |
Instance Attribute Details
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
7 8 9 |
# File 'lib/tres_raya/player.rb', line 7 def mark @mark end |
Instance Method Details
#finish(final_board) ⇒ Object
13 14 |
# File 'lib/tres_raya/player.rb', line 13 def finish( final_board ) end |
#move(board) ⇒ Object
9 10 11 |
# File 'lib/tres_raya/player.rb', line 9 def move( board ) raise NotImplementedError, "Player subclasses must define move()." end |