Order by pair comparisons: Difference between revisions
Content added Content deleted
(Realize in F#) |
(→{{header|F_Sharp|F#}}: marked incorrect: does not prompt user) |
||
Line 104: | Line 104: | ||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
{{incorrect|F_Sharp|Does not prompt user}} |
|||
<lang fsharp> |
<lang fsharp> |
||
// Order by pair comparisons. Nigel Galloway: April 23rd., 2021 |
// Order by pair comparisons. Nigel Galloway: April 23rd., 2021 |
||
Line 114: | Line 115: | ||
[Red;Orange;Yellow;Green;Blue;Indigo;Violet] sorted to [Violet; Red; Green; Indigo; Blue; Yellow; Orange] using 25 comparisons |
[Red;Orange;Yellow;Green;Blue;Indigo;Violet] sorted to [Violet; Red; Green; Indigo; Blue; Yellow; Orange] using 25 comparisons |
||
</pre> |
</pre> |
||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
Asking the user for an ordering specifier inside a custom comparator: |
Asking the user for an ordering specifier inside a custom comparator: |