Skip to content

Instantly share code, notes, and snippets.

@damionjunk
Created December 17, 2012 04:26
Show Gist options
  • Save damionjunk/4315740 to your computer and use it in GitHub Desktop.
Save damionjunk/4315740 to your computer and use it in GitHub Desktop.
(let [parts 11 ; Pre-computed, based on target ABV of 43%.
ml-target 30
;; Part/Ratios
tomatin (/ 7.5 parts)
cs (/ 2.5 parts)
dw (/ 1.0 parts)
;; Prices
t-ml-p (/ 19.99 750)
cs-ml-p (/ 79.99 750)
m12-ml-p (/ 53.99 750)
;; Map some prices and mL amounts
ml-ea (map #(* ml-target %) [tomatin cs dw])
p-ea (map #(* %1 %2) ml-ea [t-ml-p cs-ml-p m12-ml-p])]
(println "Target Serving Size:" ml-target "ml")
(println "Macallan 12 Serving Cost:" (* ml-target m12-ml-p))
(println "Tomatin 12 Serving Cost:" (* ml-target t-ml-p))
(println "Macallan CS Serving Cost:" (* ml-target cs-ml-p))
(println "MoogSherry Blend Cost:" (reduce + p-ea))
(println "mL each (t,cs,dw):" ml-ea))
;; Target Serving Size: 30 ml
;; Macallan 12 Serving Cost: 2.1596
;; Tomatin 12 Serving Cost: 0.7996
;; Macallan CS Serving Cost: 3.1995999999999998
;; MoogSherry Blend Cost: 1.468690909090909
;; mL each (t,cs,dw): (20.454545454545453 6.818181818181818 2.7272727272727275)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment