Skip to content

Instantly share code, notes, and snippets.

@tmountain
Created January 29, 2010 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tmountain/289897 to your computer and use it in GitHub Desktop.
Save tmountain/289897 to your computer and use it in GitHub Desktop.
(defn- get-chars
"gets the next char(s) in the sequence"
[s offset]
(if (>= offset (count s))
(let [div-val (dec (int (/ offset (count s))))
mod-val (mod offset (count s))]
(apply str (get-chars s div-val) (get-chars s mod-val)))
(subs s offset (inc offset))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment