Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created October 12, 2012 19:11
Show Gist options
  • Save joshcough/3880913 to your computer and use it in GitHub Desktop.
Save joshcough/3880913 to your computer and use it in GitHub Desktop.
(
(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