Hi I've hit a brick wall whilst trying to remove an element from a set.
I have a map of cards.
(def cards
{
:card1 {:name "Wisp" :type "Monster" :damage 1 :health 1 :cost 0 :charge "t"}
:card2 {:name "Spider Tank" :type "Monster" :damage 3 :health 4 :cost 3}
:card3 {:name "Boulder Fist Ogre" :type "Monster" :damage 6 :health 7 :cost 6}
}
)
And a deck (set) of these cards.
(def deck1 (set (map cards '(:card1 :card2 :card3))))
When I use disj to try and remove one of these cards nothing happens.
(disj deck1 :card1)
I really have no idea why.
leetwinski was right in the comments. (disj deck1 (:card1 cards))
is correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With