I put this on hold when I had to leave the country for a couple of months. By the time I got back no-one was posting any more so I didn't finish judging the latest entries or award a prize, but if people are still interested, I don't mind doing so. Let me know... --- Let's see if by having a competitive shoot-out we can speed up sorting in Scratch! Modify your own code and send it back to me for reincorporation in the master copy. If anyone else wants to compete, use one of these as a template and submit your entry to me and I will merge it in. NOTE! It *is* allowed to base your sort function on one of these BUT it will only be included if your result is at least 2% faster than the original!
Using MegaApuTurkUltra's timing harness as the basis of this code. The code cycles round everyone's implementations several times to record the best time for each. (The first two iterations are ignored to give the environment time to stabilize). Each user gets the same data to sort. The array does contain duplicates. Let me know if you think that the test harness is unfair to anyone's implementation - I'm definitely giving some thought to the issue that sort procedures must sort 'list' in place (effectively - copy back if you sort to another array) - this penalizes sorts that take one array as input and output to another. Note that the sort procedures will be given low and high bounds (inclusive). Any array elements outside of those bounds must not be moved.