Author Topic: Sorts in Masmlib  (Read 1949 times)

Adamanteus

  • Member
  • **
  • Posts: 239
    • LLC "AMS"
Re: Sorts in Masmlib
« Reply #15 on: March 23, 2020, 08:10:23 AM »
 I could mark, that for strings in C exists collate strings function - strcol  :eusa_boohoo:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7837
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Sorts in Masmlib
« Reply #16 on: March 23, 2020, 10:27:17 AM »
I should have explained, in QE its the tokeniser that strips out the high ascii, in order, load the text file, tokenise it then sort the tokenised array.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 1428
  • building nextdoor
Re: Sorts in Masmlib
« Reply #17 on: March 24, 2020, 09:02:22 PM »
Yes, don't you?

Me too. QSort() uses this order, also in case-insensitive mode.

It becomes more complex with Utf8 text or Umlaute (äöü), of course:
Code: [Select]
1.1 motiviation
1.2 Sorting in Java
1. unbelievable point
1 Introduction
Adele
andere
Ändern
anders
ängstlich
zippy
zone

Apparently, Java can do that. It's probably slow, because you need a lookup table to do that (QSort has one, but it's almost undocumented).

What is your specific problem, i.e. why do you need characters above Ascii 127? Just curious.
this would be interesting to make custom sort for:
look it seems like random order,almost like sort Roman numbers need to be,I=1,C=100,M=1000,X=10,but ascii in complete other order,C,I,M,X
Code: [Select]
/*
1: 一
2: 二
3: 三
4: 四
5: 五
6: 六
7: 七
8: 八
9: 九
10: 十
11: 十一  十一
12: 十二 十二
20: 二十 二十
50: 五十 五十
100: 百 (Japanese: hyaku, Chinese: bai)
1000: 千 (Japanese: sen, Chinese: qian)
10,000:  万 (Japanese: man)
10,000:  萬 (Chinese: wan)
10^8: 億 (Japanese: oku)
10^8: 亿 亿 (Chinese: yi)
10^12: 兆 (Japanese: chou, Chinese: jhao)
*/
Showcase :
With Masm sdk and 2-3 hours = a windows program :D
Beat that C zealots p:

deeR44

  • Regular Member
  • *
  • Posts: 35
Re: Sorts in Masmlib
« Reply #18 on: July 21, 2020, 05:07:17 PM »
I should have explained, in QE its the tokeniser that strips out the high ascii, in order, load the text file, tokenise it then sort the tokenised array.
Ok, I give up. What's "QE"? Quality Engineering?

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7837
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Sorts in Masmlib
« Reply #19 on: July 21, 2020, 05:54:39 PM »
Well, I could be tempted to boast about it being "Quality Engineering" but its the abbreviation of the editor I write that is installed in the MASM32 SDK. It has been called "Quick Editor" for over 20 years from its pre year 2000 version up to current.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

deeR44

  • Regular Member
  • *
  • Posts: 35
Re: Sorts in Masmlib
« Reply #20 on: November 02, 2020, 05:05:27 PM »
Quote
... It has been called "Quick Editor" for over 20 years from its pre year 2000 version up to current.

Thank you, Hutch. I'm not familiar with many editors since I've been using one called "VEDIT" for something like forty years.