aboutsummaryrefslogtreecommitdiffstats
path: root/board.rb
diff options
context:
space:
mode:
authorTeddy Wing2015-04-14 18:40:47 -0400
committerTeddy Wing2015-04-14 18:40:47 -0400
commitda8707f50f40b325df86efaa26f821142c89662c (patch)
tree828b54e083323275af828d9377a9ded23408b2a5 /board.rb
parent07885399cb161c38244a9c8a564939c7b98bf4ba (diff)
downloadtic-tac-toe-da8707f50f40b325df86efaa26f821142c89662c.tar.bz2
Flesh out the game loop
* Use a new, currently empty `Board#winner?` method as our loop condition * Add `Player#insignia` so we can print the correct player insignia depending on who the current player is * Print the board and a prompt for coordinates * Switch the current player after a player finishes moving
Diffstat (limited to 'board.rb')
-rw-r--r--board.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/board.rb b/board.rb
index 5db93fd..df66a8d 100644
--- a/board.rb
+++ b/board.rb
@@ -1,4 +1,6 @@
class Board
+ attr_accessor :current_player
+
def initialize
@board = [
['.', '.', '.'],
@@ -29,4 +31,7 @@ class Board
def update_cell(row_index, column_index, value)
@board[row_index][column_index] = value
end
+
+ def winner?
+ end
end