Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def zone {:b [{:target :a, :direction :north, :cost 1} {:target :e, :direction :south-east, :cost 4}],
- :a [{:target :b, :direction :south, :cost 1} {:target :c, :direction :east, :cost 2}],
- :e [],
- :c [{:target :d, :direction :south, :cost 1}],
- :d [{:target :e, :direction :south, :cost 1}]}
- )
- #Given key A I want to find all connecting rooms
- (map #(get % :target) (get zone :a []))
- => (:b :c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement