Sort the letters of string in alphabetical order: Difference between revisions
Content added Content deleted
(Added Quackery.) |
(→{{header|Quackery}}: fixed to comply with task requirements) |
||
Line 1,239: | Line 1,239: | ||
=={{header|Quackery}}== |
=={{header|Quackery}}== |
||
With regard to the [[Talk:Sort the letters of string in alphabetical order|discussion]] regarding the nature of the task, I am construing the |
With regard to the [[Talk:Sort the letters of string in alphabetical order|discussion]] regarding the nature of the task, I am construing the phrases "alphabetical order" and "lexicographical order" to mean QACSFOT order. ('''''Q'''uackery '''A'''rbitrary '''C'''haracter '''S'''equence '''F'''or '''O'''rdered '''T'''ext'') |
||
We take the 96 printable characters that Quackery recognises in their native (ASCII/Unicode) order, and sort them into QACSFOT order using a word <code>qacsort</code> that we have defined to do that. |
|||
<syntaxhighlight lang="Quackery"> [ sortwith [ qacsfot dip qacsfot > ] ] is qacsort ( $ --> $ ) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
qacsort echo$</syntaxhighlight> |
|||
{{out}} |
{{out}} |
||
⚫ | |||
⚫ | |||
... |
|||
⚫ | |||
⚫ | |||
⚫ | |||
... sortwith [ qacsfot dip qacsfot > ] |
|||
... dup echo$ cr cr |
|||
... say "Native order:" cr |
|||
... sort |
|||
... echo$ cr |
|||
... |
|||
⚫ | |||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
||
QACSFOT order: |
QACSFOT order: |
||
0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz()[]{}<>~=+-*/^\|_.,:;?!'"`%@&#$ |
0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz()[]{}<>~=+-*/^\|_.,:;?!'"`%@&#$</pre> |
||
Native order: |
|||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
|||
Stack empty. |
|||
/O> </pre> |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |