Skip to content

Instantly share code, notes, and snippets.

@feuery
Created August 23, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feuery/a07496672b23a74988f7b4fc05936464 to your computer and use it in GitHub Desktop.
Save feuery/a07496672b23a74988f7b4fc05936464 to your computer and use it in GitHub Desktop.
(def rooms [{:x 0 :y 0 :w 3 :h 3}
{:x 2 :y 2 :w 2 :h 1}
{:x 5 :y 2 :w 10 :h 1}])
(for [[x y w h :as a] (map (juxt :x :y :w :h) rooms)
[x2 y2 w2 h2 :as b] (map (juxt :x :y :w :h) rooms)
:when (not= a b)]
(square-collision? a b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment