aboutsummaryrefslogtreecommitdiffstats
path: root/main.rb
diff options
context:
space:
mode:
Diffstat (limited to 'main.rb')
-rw-r--r--main.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.rb b/main.rb
index dedf9f7..4a3c10f 100644
--- a/main.rb
+++ b/main.rb
@@ -6,9 +6,17 @@ player_1 = Player.new(Player::INSIGNIAS[:x], board)
player_2 = Player.new(Player::INSIGNIAS[:o], board)
board.current_player = player_1
-until board.winner
+until board.winner?
+ puts board.render
+ puts
+
+ print "Player #{board.current_player.insignia} move - " \
+ "Enter coordinates (e.g. 0,2): "
+
coordinates = gets.chomp
coordinates = board.transform_coordinates(coordinates)
board.current_player.move(coordinates)
+
+ board.current_player = board.current_player == player_1 ? player_2 : player_1
end