Sort the letters of string in alphabetical order: Difference between revisions

→‎{{header|Quackery}}: fixed to comply with task requirements
(Added Quackery.)
(→‎{{header|Quackery}}: fixed to comply with task requirements)
Line 1,239:
=={{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 wordsphrases "alphabetical order" and "lexicographical order" to mean QACSFOT order. (''Quackery'''Q'''uackery Arbitrary'''A'''rbitrary Character'''C'''haracter Sequence'''S'''equence For'''F'''or Ordered'''O'''rdered Text'''T'''ext'').
 
The task is presented as a dialogue in the Quackery Shell: weWe take the 96 printable characters that Quackery recognises in their native (ASCII/Unicode) order, and sort them into QACSFOT order, andusing thena backword into<code>qacsort</code> nativethat orderwe have defined to do that.
 
<syntaxhighlight lang="Quackery"> [ sortwith [ qacsfot dip qacsfot > ] ] is qacsort ( $ --> $ )
 
<pre>/O> [] 94 times [ i^ 1+ space + join ]
 
... say "Native order:" cr
... dup echo$ cr cr
... say "QACSFOT order:" cr
qacsort echo$</syntaxhighlight>
 
{{out}}
 
<pre>Native order:
<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()[]{}<>~=+-*/^\|_.,:;?!'"`%@&#$</pre>
 
Native order:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
 
Stack empty.
 
/O> </pre>
 
=={{header|Raku}}==
1,462

edits