Skip to content

Instantly share code, notes, and snippets.

@tcrayford
Created January 12, 2010 00:49
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 tcrayford/274767 to your computer and use it in GitHub Desktop.
Save tcrayford/274767 to your computer and use it in GitHub Desktop.
; Answers http://www.rubyquiz.com/quiz76.html
(defn text-munger [string]
(for [word (re-split #"\s" string)]
(if (> (count word) 3)
(let [start (first word)
end (last word)]
(str start (reduce str (shuffle (drop 1 (take (- (count word) 1) word))))
end)) word)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment