Skip to content

Instantly share code, notes, and snippets.

@adellhk
Last active August 29, 2015 14:28
Show Gist options
  • Save adellhk/1bafc78b6ea072fc1ba0 to your computer and use it in GitHub Desktop.
Save adellhk/1bafc78b6ea072fc1ba0 to your computer and use it in GitHub Desktop.
def vert(board)
board[0].each_with_index do |cell, column_num|
puts "Cell: #{cell}"
if cell == "x"
column = []
4.times do |row_num|
column << board[row_num + 1][column_num]
end
puts "#Column: #{column}"
return true if column.count('x') == 4
end
end
return false
end
def vert(board)
board.transpose.include?( %w(x x x x x) )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment