Last active
December 29, 2015 12:09
-
-
Save tarynsauer/7668741 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def create_board_hash | |
new_board = Hash.new | |
alpha = 'A' | |
numeric = 1 | |
num_of_rows.times do | |
num_of_rows.times do | |
key = numeric.to_s + alpha | |
numeric += 1 | |
new_board[key] = nil | |
end | |
alpha = alpha.next | |
numeric = 1 | |
end | |
new_board | |
end | |
def get_winning_lines | |
lines = [] | |
winning_rows.each { |row| lines << row } | |
winning_cols.each { |col| lines << col } | |
winning_diagonals.each { |diagonal| lines << diagonal } | |
lines | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment