f = [1, 1, 4, 5, 1, 4] 10.times do for a in 0..4 if f[a] > f[a+1] g = f[a+1] f[a+1] = f[a] f[a] = g end end end p f
To embed this project on your website, copy the following code and paste it into your website's HTML: