Hi 4tH-ers!
You know I have a weak spot for randomizers and sorters. I recently found out I implemented a George Marsaglia three times. In different ways. Which is interesting in itself.
However, I was happy to find the "Foldsort" algorithm, which only does sizes of powers of two, because it bears a resemblance to "Circlesort" - an algorithm of my design.
I first coded it in uBasic/4tH - and then in 4tH. It pretty much ran first time.
I also designed "Runsort", which was designed to take advantage of already existing sorted sequences in things. But it's slower than expected - even after an effort to improve it.
Still, I improved it once more. Now it is about 16 times faster than the previous version, but still 100 times slower than "Circlesort". That is - with a completely random sequence. I haven't (sufficiently) tested it with partly sorted arrays. I guess the main thing is it uses *SMOVE* - which is about as fast as C.
Code in SVN.
Hans Bezemer