Skip to content

Instantly share code, notes, and snippets.

def bal = 994000.0
def wc = 1.0
def mb = -5000
def maxW = (bal - mb) / ((wc / 100) + 1)
println("MaxWithDraw [$maxW]" +
" ChargeAmount[${(wc / 100 * maxW)}]" +
" BalaceMinusWithdraw [${bal - maxW - wc / 100 * maxW}]")
@kayr
kayr / mars-rover.clj
Created January 6, 2020 15:55
Mars rover clojure
(ns mars-rover)
(def directions [:n :e :s :w])
(def opposites {:e :w
:w :e
:n :s
:s :n})
(defmulti move-step (fn [_ dir] dir))