lib/ttt.rb
def winner_column(board, value, length)
    m_board = Matrix[*board]
    i = 0
    while i < length.to_i
      winner = m_board.column(i).all? {|v| v == value}
      if winner
        return true
        break
      end
      i += 1
    end
  end
#Check on the board if the player won in any of the columns
Check on the board if the player won in any of the columns
Check on the board if the player won in any of the columns
def winner_column(board, value, length)
    m_board = Matrix[*board]
    i = 0
    while i < length.to_i
      winner = m_board.column(i).all? {|v| v == value}
      if winner
        return true
        break
      end
      i += 1
    end
  end
def winner_column ( board , value , length ) m_board = Matrix [ * board ] i = 0 while i < length . to_i winner = m_board . column ( i ) . all? { | v | v == value } if winner return true break end i += 1 end end
Check on the board if the player won in any of the columns
Check on the board if the player won in any of the columns
board
value
length