JortSort: Difference between revisions
→{{header|UNIX Shell}}: Add implementation
(→{{header|AppleScript}}: Added a draft in AppleScript) |
(→{{header|UNIX Shell}}: Add implementation) |
||
Line 1,203:
1
</pre>
=={{header|UNIX Shell}}==
{{works with|Bourne Again SHell}}
<lang sh>
JortSort() {
cmp -s <(printf “%s\n” “$@“) <(printf “%s\n” “$@“ | sort)
}
JortSortVerbose() {
if JortSort “$@“; then
echo True
else
echo False
If
}
JortSortVerbose 1 2 3 4 5
JortSortVerbose 1 3 4 5 2
JortSortVerbose a b c
JortSortVerbose c a b
</lang>
{{Out}}
<pre>True
False
True
False</pre>
=={{header|VBScript}}==
|