This is a 'find and transpose' algorithm. A list is generated and randomized. Another list is generated to select numbers to find from the random list. When the selected number is found, the number of simulated comparisons is added to the sum, and the number is swapped with the value to the left to give the number higher precedence. This problem was inspired by the last problem on the 2012 Bebras Challenge (PDF): http://www.beaver-comp.org.uk/uploads/2/1/8/6/21861082/bcccontest2012.pdf
EDIT: I modified the program so that it stops running when the maximum number of comparisons is reached (64). The original list is stored to allow for analysis. The worst case scenario starting list is [9, 0, 1, 2, 3, 4, 5, 6, 7, 8] It took 7 minutes to run 1 million trials in Turbo Mode. 64 comparisons are possible for 10 list items in a worst case scenario. To save time, run fewer trials. You can also view the variables and lists, but this slows down the run time, also.