Created
October 12, 2012 19:11
-
-
Save joshcough/3880913 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 roof (bigx bigz smallx smallz y m) | |
(if (eq bigx smallx) unit | |
(begin | |
(corners (loc bigx y bigz) (loc smallx y smallz)) | |
(setall m) | |
(roof (- bigx 1) (- bigz 1) (+ smallx 1) (+ smallz 1) (+ 1 y) m) | |
) | |
) | |
) | |
(def house (w h d) | |
(begin | |
(corners (loc w (+ Y h) d) (loc (- 0 w) Y (- 0 d))) | |
(setall (material "air")) | |
; build walls and floor | |
(floor (material "stone")) | |
(walls (material "brick")) | |
; build roof | |
(roof (+ 1 w) (+ 1 d) (- -1 w) (- -1 d) (+ Y h 1) (material "wood")) | |
) | |
) | |
(house 5 8 5) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment