Skip to content

Instantly share code, notes, and snippets.

@theRemix
Created February 27, 2018 18:34
Show Gist options
  • Save theRemix/68ccccc2d7621f015afa6f592d3e9ca7 to your computer and use it in GitHub Desktop.
Save theRemix/68ccccc2d7621f015afa6f592d3e9ca7 to your computer and use it in GitHub Desktop.
BlondPiercingTechnician created by theRemix - https://repl.it/@theRemix/BlondPiercingTechnician
(let [base 3,
exp 3]
(do
(defn multiply [x, y]
(* x y))
(defn exponent
([base pow] (exponent base base (dec pow)))
([acc base pow] (cond
(> pow 0) (exponent (multiply acc base) base (dec pow))
:else acc)))
(exponent base exp)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment