Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Last active December 29, 2015 12:09
Show Gist options
  • Save tarynsauer/7668741 to your computer and use it in GitHub Desktop.
Save tarynsauer/7668741 to your computer and use it in GitHub Desktop.
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