Jump to content

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}}==
1,480

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.