4 ms·
Holy shit. I independently invented... well, not quite "invented", more like "stumbled into" this algorithm when I was in elementary school learning Applesoft B
by apricot 5y ago
Holy shit. I independently invented... well, not quite "invented", more like "stumbled into" this algorithm when I was in elementary school learning Applesoft BASIC, and wanted to sort an array of numbers. I had no clue how to do it and just intuited there had to be two loops, one inside the other. I got the comparison wrong, saw that it sorted backwards, and just changed > to < without asking myself why it worked.