If the sorting is taking too long, try turning on Turbo Mode (by pressing shift and clicking the green flag). Have you ever heard that if you give a monkey on a typewriter an infinite amount of time to press random keys, it will eventually write the complete works of William Shakespeare? That's called the "infinite monkey theorem". The basic idea of the infinite monkey theorem is that if something completely random and uncontrollable goes on forever, it will eventually give any desired results. Introducing, Bogosort! Bogosort (or Monkey Sort, or Random Sort, or one of its other five trillion names) is a sorting algorithm that randomizes the order of a list and then checks if the new list is sorted. The process will be repeated until a randomized list is found to be sorted in the intended order. As a side effect of its random nature, Bogosort could theoretically sort millions of numbers in a single iteration. However, this is extremely unlikely to happen, and Bogosort is beyond impractical for even the smallest lists. Read more about Bogosort and the infinite monkey theorem on Wikipedia: https://en.wikipedia.org/wiki/Bogosort https://en.wikipedia.org/wiki/Infinite_monkey_theorem
Google doesn't seem to know who invented Bogosort, so I guess I can't credit them. The infinite monkey theorem has a long and complicated history, but it's usually credited to Arthur Eddington. Everything else should be 100% made by me. (I mean, except for the Scratch engine, but that doesn't count, I think.) 1.3 (December 31, 2020) *Added the option to add a random number. Thanks to @ninjamar for the suggestion 1.2 (October 3, 2020): *Inputs will now cancel if you enter an invalid value instead of forcing you to write a valid one. *Added "Slowness (iterations per item)" value, just for fun. 1.1 (August 6, 2019): *The list altering buttons can no longer be used while sorting. The ascending and descending ones are still completely usable, though, so have fun teasing Bogosort with your ever-changing goalposts. Thanks to @seanbobe for caring about this in the first place