Skip to content

Instantly share code, notes, and snippets.

@jadudm
Created January 12, 2015 17:36
Show Gist options
  • Save jadudm/e828d0983fdf33918ff3 to your computer and use it in GitHub Desktop.
Save jadudm/e828d0983fdf33918ff3 to your computer and use it in GitHub Desktop.
Playing with price points...
(define repeat
(λ (times)
(λ (n)
(cond
[(zero? times)
'()]
[else
(cons n ((repeat (sub1 times)) n))]))))
(define inputs
(apply append
(map (λ (n decls)
(map (λ (b)
(+ n b))
(map (λ (n) (* .1 n)) decls)))
(range 0 10)
((repeat 10) (range 0 10)))))
(define price-points
(map (λ (x y)
(vector x y))
inputs
(map profit inputs)))
(plot (points price-points)
#:y-max (+ (apply max (map profit inputs)) 300)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment