Created
June 11, 2017 23:07
-
-
Save jjhop/e982100ade2f4316e4c7c8c43a9b0aad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def upper-left '(0,0)) | |
(def lower-right '(5,5)) | |
(defn calculate-area [ul, lr] | |
(let [width (- (nth lr 0) (nth ul 0)) | |
height (- (nth lr 1) (nth ul 1))] | |
(* width height))) | |
(calculate-area upper-left lower-right) | |
(calculate-area '(12 15) '(56 123)) | |
;; etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment