Advertisement
Guest User

Untitled

a guest
Jun 28th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (def zone {:b [{:target :a, :direction :north, :cost 1} {:target :e, :direction :south-east, :cost 4}],
  2.  :a [{:target :b, :direction :south, :cost 1} {:target :c, :direction :east, :cost 2}],
  3.  :e [],
  4.  :c [{:target :d, :direction :south, :cost 1}],
  5.  :d [{:target :e, :direction :south, :cost 1}]}
  6. )
  7.  
  8.  
  9. #Given key A I want to find all connecting rooms
  10. (map #(get % :target)  (get zone :a  []))
  11. => (:b :c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement