one-loop sorting of strings by their length

Post your working scripts, libraries and tools
rommmcek
Posts: 294
Joined: 15 Aug 2014, 15:18

Re: one-loop sorting of strings by their length

21 Nov 2017, 20:12

New version of test. Better display of results. Added new binary function by Hegef. Hope no new bugs! Wordlist & description in posts above.

Please use code below!

P.s.: Attachment below only for Helgef as a remuneration for his commitments on this thread, because he has used emoji with Santa Clause cap and we are at the end of the year. (Experimental as a byproduct of an other code which included sorting)
Attachments
All_I_Want_For_Christmas_Is_AutoHotkey.ahk
(535.4 KiB) Downloaded 9 times
Last edited by rommmcek on 02 Dec 2017, 07:40, edited 1 time in total.
Helgef
Posts: 2469
Joined: 17 Jul 2016, 01:02
Contact:

Re: one-loop sorting of strings by their length

23 Nov 2017, 17:56

Thank you very much for the beautiful song, very impressive! :xmas:
Minor comments, g and f should use byref, and you need to omit "`r" for the strsplit after sort_len. I made a bug fix to the sort_len function :arrow: github. The bug didn't matter in your tests though. :oops:

Cheers
User avatar
jeeswg
Posts: 2938
Joined: 19 Dec 2016, 01:58
Location: UK

Re: one-loop sorting of strings by their length

23 Nov 2017, 18:18

Yes, the song is very good, it is pretty spectacular. I had it on repeat, it helped me do some coding the other day.
How about these 2 (very short) songs? You could start a new thread.
- Bottles of beer on the wall... [4 lines or less challenge] - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?p=181761#p181761
- 10 Green Bottles.
Cheers. :xmas:
rommmcek
Posts: 294
Joined: 15 Aug 2014, 15:18

Re: one-loop sorting of strings by their length

24 Nov 2017, 06:38

@Hegef: As the present should be!
P.s.: I postponed sorting tests because of music. (The most pleasant first!)
@Jeeswg: Should be good for any music (even if it still needs some (a lot of) work)!
Note, that I'm no musician, so I depend on others work.
P.s.: I've been thinking about new thread, but the code is real mess at the moment.
rommmcek
Posts: 294
Joined: 15 Aug 2014, 15:18

Re: one-loop sorting of strings by their length

02 Dec 2017, 07:38

New update for tests.
Functions f() & g() now have ByRef to ensure using same memory location for function's parameter & variable.
I abandoned ending up with arrays! (I think it has actually not much to do with sorting of strings by their length), but thank you Helgef, for reminding me "`r" should be omitted in StrSplit()
For display I'm using now Notepad choosing Consolas Font. It will display entire list. (No need for editing the wordlist, hope it'll work for everybody!)

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

To do: Sorting by numbers. (Not sure if it's doable with sort_len() function.)

P.s.: @Helgef: How fast is sort_len() in c in comparison with other c sorting function?
Last edited by rommmcek on 02 Dec 2017, 15:57, edited 3 times in total.
Helgef
Posts: 2469
Joined: 17 Jul 2016, 01:02
Contact:

Re: one-loop sorting of strings by their length

02 Dec 2017, 13:39

Note, WinWaitActive, Untitled ahk_class Notepad,, 1 will not work on non-english OS.
To do: Sorting by numbers. (Not sure if it's doable with sort_len() function.)

P.s.: @Helgef: How fast is sort_len() in c in comparison with other c sorting function?

sort_len sorts only by string length, it cannot do anything else. I have not compared it to anything.

Cheers :xmas:
rommmcek
Posts: 294
Joined: 15 Aug 2014, 15:18

Re: one-loop sorting of strings by their length

02 Dec 2017, 15:03

Fixed, Thanks!!!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Google [Bot], omareg94 and 31 guests