I have the variable cards with empty values:
(def cards [0 0 0])
Im trying to set a value of cards (depending on input) to a 3 within a function. Thats why i have the following code:
(defn parse-int [s]
(Integer. (re-find #"\d+" s )))
(defn changevalue [] (assoc cards (parse-int (read-line)) 3))
(changevalue)
But when i execute the problem and typ in my input 1, the function doesn't change the value of key 1, and when i print it, its still 0 0 0 . How do I fix this?
Im sure the parse-int works, i got it from: In Clojure how can I convert a String to a number?