diff options
| author | Teddy Wing | 2015-04-14 18:18:33 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-04-14 18:19:22 -0400 |
| commit | a9698b70d47e5c4914d27b38baccd9feec8479a8 (patch) | |
| tree | 27fba0805123ef2e4f4cdca329b1b5d519b13783 /player.rb | |
| parent | e6910571b4bb9f65a241df9ff28ff4cfbb832aa5 (diff) | |
| download | tic-tac-toe-a9698b70d47e5c4914d27b38baccd9feec8479a8.tar.bz2 | |
Player: Add a `#move` method to move a piece to a cell on the board
Also add `Board#update_cell` to facilitate player movement.
Diffstat (limited to 'player.rb')
| -rw-r--r-- | player.rb | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -8,4 +8,10 @@ class Player @insignia = insignia @board = board end + + def move(coordinates) + raise ArgumentError if coordinates.nil? + + @board.update_cell(coordinates[0], coordinates[1], @insignia) + end end |
