Skip to content

Instantly share code, notes, and snippets.

@xiaq
Created October 7, 2016 13:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaq/eefcc4be1f5aa823631e8c5cf4986e97 to your computer and use it in GitHub Desktop.
Save xiaq/eefcc4be1f5aa823631e8c5cf4986e97 to your computer and use it in GitHub Desktop.
fn quick-sort [li]{
if <= (count $li) 1; then
put $@li
else
quick-sort [(each { if <= $0 $li[0]; then put $0; fi } $li[1:])]
put $li[0]
quick-sort [(each { if > $0 $li[0]; then put $0; fi} $li[1:])]
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment