![]()
So I made my own sorting algorithm a few days ago!
GitHub page with JavaScript code and explanation:
![]()
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.
An O(n^2) sorting algorithm made by me.
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.
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.
That doesn't actually work (sorry):


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 ", "):
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?
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:
PS: These extra spaces are ESPECIALLY important when sorting. Here is an example:

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).
This is the near-invisible difference.
I wonder why snap doesn’t use the brown circles.