Class: Gato
- Inherits:
-
Object
- Object
- Gato
- Defined in:
- lib/Gato.rb
Instance Attribute Summary collapse
-
#board ⇒ Object
Returns the value of attribute board.
-
#currentPlayer ⇒ Object
Returns the value of attribute currentPlayer.
-
#isFinished ⇒ Object
Returns the value of attribute isFinished.
Instance Method Summary collapse
-
#initialize ⇒ Gato
constructor
A new instance of Gato.
- #intended_move(row, column) ⇒ Object
Constructor Details
Instance Attribute Details
#board ⇒ Object
Returns the value of attribute board.
12 13 14 |
# File 'lib/Gato.rb', line 12 def board @board end |
#currentPlayer ⇒ Object
Returns the value of attribute currentPlayer.
12 13 14 |
# File 'lib/Gato.rb', line 12 def currentPlayer @currentPlayer end |
#isFinished ⇒ Object
Returns the value of attribute isFinished.
12 13 14 |
# File 'lib/Gato.rb', line 12 def isFinished @isFinished end |
Instance Method Details
#intended_move(row, column) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/Gato.rb', line 26 def intended_move(row, column) result_operation = 0 if not is_in_bounderies?(row, column) result_operation = INVALID_POSITION elsif not is_empty?(row-1, column-1) result_operation = BOX_TAKEN else result_operation = update_game(row-1, column-1) end result_operation end |