Sort the letters of string in alphabetical order: Difference between revisions
Sort the letters of string in alphabetical order (view source)
Revision as of 11:10, 8 February 2024
, 4 months ago→{{header|Wren}}: Changed to Wren S/H
(Added Quackery.) |
m (→{{header|Wren}}: Changed to Wren S/H) |
||
(One intermediate revision by one other user not shown) | |||
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
<syntaxhighlight lang="Quackery"> [ sortwith [ qacsfot dip qacsfot > ] ] is qacsort ( $ --> $ )
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
▲Native order:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
QACSFOT order:
0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz()[]{}<>~=+-*/^\|_.,:;?!'"`%@&#$</pre>
=={{header|Raku}}==
Line 1,450 ⟶ 1,441:
=={{header|Wren}}==
Well, we'll write a function for a bubble sort which we don't have in Wren-sort because it's normally much slower than the other methods. However, it's fast enough here.
<syntaxhighlight lang="
var chars = s.toList
var n = chars.count
|