Sort the letters of string in alphabetical order: Difference between revisions
Content added Content deleted
(add RPL) |
(Added Quackery.) |
||
Line 1,236: | Line 1,236: | ||
{{Out}} |
{{Out}} |
||
<pre>" ?Iaaaaaaaabbcceeefghhhiiiiiijkllllllmnoopppsssssttt"</pre> |
<pre>" ?Iaaaaaaaabbcceeefghhhiiiiiijkllllllmnoopppsssssttt"</pre> |
||
=={{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 words "alphabetical order" and "lexicographical order" to mean QACSFOT order. (''Quackery Arbitrary Character Sequence For Ordered Text''). |
|||
The task is presented as a dialogue in the Quackery Shell: we take the 96 printable characters that Quackery recognises in their native (ASCII/Unicode) order, and sort them into QACSFOT order, and then back into native order. |
|||
{{out}} |
|||
<pre>/O> [] 94 times [ i^ 1+ space + join ] |
|||
... |
|||
... say "Native order:" cr |
|||
... dup echo$ cr cr |
|||
... say "QACSFOT order:" cr |
|||
... sortwith [ qacsfot dip qacsfot > ] |
|||
... dup echo$ cr cr |
|||
... say "Native order:" cr |
|||
... sort |
|||
... echo$ cr |
|||
... |
|||
Native order: |
|||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
|||
QACSFOT order: |
|||
0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz()[]{}<>~=+-*/^\|_.,:;?!'"`%@&#$ |
|||
Native order: |
|||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
|||
Stack empty. |
|||
/O> </pre> |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |