nums = []

5.times do |i|
	nums[i] = 20+Random.rand(11)
end

sorted = false
while sorted == false

	sorted = true
	nums[1..-1].each do |i|
		if nums[i] > nums[i-1]
			sorted = false
			break
		end
	end

	if sorted == false
		first_i = Random.rand(nums.length)
		second_i = first_i

		while first_i == second_i
			second_i = Random.rand(nums.length)
		end
		
		tmp = num[first_i]
		num[first_i] = num[second_i]
		num[second_i] = tmp
	end

end