Created
April 30, 2013 18:53
-
-
Save marklocklear/5491006 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main.rb | |
require "./include.rb" | |
@board = Array.new | |
@board = {'ul' => 'ul', 'um' => 'um', 'ur' => 'ur', | |
'ml' => 'ml', 'mm' => 'mm', 'mr' => 'mr', | |
'll' => 'll', 'lm' => 'lm', 'lr' => 'lr'} | |
puts "Enter a move in the following sequence\n | |
ul um ur\n | |
ml mm mr\n | |
ll lm lr\n" | |
@active = true | |
while @active do | |
print "Player(X) #1 Enter move:" | |
var = gets.chomp | |
@board[var] = 'X' | |
check_for_winner | |
show_board | |
print "Player(O) #2 Enter move:" | |
var = gets.chomp | |
@board[var] = 'O' | |
check_for_winner | |
show_board | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment