Sorting array with bubble sort :     array = [4,3,2,1]
    
    sorted = false
     
    unless sorted == true
        swapped = false
        array.each_with_index do |x,i|
            if i <= array.length - 2
                if array[i] > array[i+1]
                    array[i] , array[i+1] = array[i+1],array[i]
                    swapped = true
                end
           end
            if swapped == false
                sorted = true
            end
        end
    
        
    end
    
    
    
            
    print array

Hi, I am trying to sort the array in a bubble_sort style. I am unable to sort the element in ascending order.