Skip to content

Instantly share code, notes, and snippets.

@alvesjnr
Created January 16, 2014 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvesjnr/8460020 to your computer and use it in GitHub Desktop.
Save alvesjnr/8460020 to your computer and use it in GitHub Desktop.
(import [random [shuffle]])
(defn quick [s]
(if (len s)
(+ (quick (list-comp x [x s] (< x (first s)) ))
[(first s)]
(quick (list-comp x [x s] (> x (first s)) ))
)
[]
)
)
(defn main []
(setv k (range 20))
(print k)
(shuffle k)
(print k)
(print (quick k))
)
(if (= __name__ "__main__")
(main)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment