https://snap.berkeley.edu/snap/snap.html#present:Username=polymations&ProjectName=Label%20Sort%20Demonstration
So I made my own sorting algorithm a few days ago!
GitHub page with JavaScript code and explanation:
cool!
What is this supposed to do? I can't access github.
LabelSort
An O(n^2) sorting algorithm made by me.
Explanation
Label Sort assigns labels to each element and sorts the elements by their labels using Pigeonhole sort, and repetitively does this until you can't do it anymore.
- Set a variable c to the unsorted array.
- Until c = array:
- Set a variable l to 0.
- Set c to the array.
- Assign label l to the first element.
- Set variables min and max to 0.
- For each next element:
- If the previous item is greater than this one:
- Decrease l by one.
- Assign label l to this element.
- If l is less than min:
- Set min to l.
- If the previous item is less than this one:
- Increase l by one.
- Assign label l to this element.
- If l is greater than max:
- Set max to l.
- Otherwise:
- Assign label l to this element.
- For i goes from min to max, create a bucket for i labeled-numbers.
- Put each element into each bucket based on label numbers.
- For i goes from min to max, insert bucket i into the original array.
Once you can't do the process anymore, you should have your sorted array.
You know you can just use that so you don’t have to just put a “, “ and you can just put a comma by itself too btw.
(Typing all these script pic links are so hard!)
That doesn't actually work (sorry):

As you can see, there are spaces before each of the numbers in the list other than the first one. Why? Let's take a look:
The AND block reports its first input if there aren't any false values. In this case neither 44 nor 32 is false. The AND block's first input is 44, so that is what it reports:
A similar issue applies to the or block: it returns the first input that is not false (or zero). In this case UNICODE 44 AS LETTER (aka a comma) is not false or zero, so the and block reports the comma:
We aren't splitting the ANSWER by "," or ", " - we are just splitting it by a comma. Therefore, the SPLIT BY block reports a list which has spaces leftover:
Unfortunately, just because your code reads as though it should work, it doesn't actually work the way you thought.
Here is a piece of code that does:
Here is a better demonstration:

Huh? Can't you just upload the picture?
Edit: I see! You're linking to the picture as well for people who have trouble getting the original image. That's nice of you, but, just so you know, in taller/wider images such as your own, the forum allows the user to see the original image (which can be imported into Snap! properly) no matter what. So you only need to worry about that when you're sharing a very small script/block.
huh?
Oh so it doesn’t work. In my tests it worked but its ok if it doesn’t work it was just a suggested script.
It was too hard on my iPad because i had to download the script from the editor and upload to my files then properly format it in the files then upload it into the forums. So i found out typing it was easier and i also like playing with the link like the fake .kingnicoandhenhencostompicturefont) idk how that works because it’s so diferentes form the jpg and png formats lol!
Sorry, I'm having trouble understanding what this means. Do you mean "it doesn't work in my tests but I thought it worked" or "it doesn't work, but In the tests it worked." Because if it's the second, please share a result pic, maybe you found a bug!
Here it is with punctuation (or what I assume is where the punctuation is supposed to go).
Just saying, it took me a bit to understand this as well.
thanks. in that case, to @kingnico1133,
They probably either
a) tried it with commas only (not testing ", "):
or b) tried spaces but didn't notice the spaces preceding the items:
For why this works the way it does, see my previous post.


For why this works the way it does, see my previous post.
Sorry but are you saying it works or doesn’t?
I'll add this to the project
Also does "a ,b ,c ,..." also work?
Though they seem to work fine, they are inconsistent

They both seem to be working fine to me?
There are spaces before and after the "is", and before the "fun". This is the near-invisible difference.

Sorry but are you saying it works or doesn’t?
It does not work. Sorry for the confusion. What I meant was:

For an explanation on why this BEHAVES the way it does, see my previous post.
Here is a list of the stages of your code. If you don't understand why one stage behaves the way it does, please ask. I'll be happy to go more in depth.
Thus, this:
is the same as this:
By contrast, this script will split by every possible combination of spaces and commas before flattening the result (for a more in depth explanation of this script, just ask

PS: These extra spaces are ESPECIALLY important when sorting. Here is an example:
Why do the Z's come before the A's? Because space comes before A in a sorting algorithm like this!
The problem with just splitting by commas with spaces, is that a user might type multiple spaces.
However this can be fixed by just trimming the spaces after splitting by a comma
But then you run into an issue when a user wants to use a comma in their text, there's no way to escape it, unless you split by csv.
Though that does result in the user not being able to keep the spaces, but at that point, you'd be better off writing your own parser.

The problem with just splitting by commas with spaces, is that a user might type multiple spaces.
I know. I think the best bet is to have constant syntax (like csv).