On Thu, Nov 26, 2009 at 4:37 AM, Chris Jenkins <[email protected]> wrote:
>
> (defn flip-cell [b x y]
>   (let [row      (nth b y)
> cell     (nth row x)
> new-cell (- 1 cell)
> new-row  (assoc row x new-cell)]
>     (assoc b y new-row)))
>

(defn flip-cell [b x y]
  (update-in b [y x] #(- 1 %)))

:)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to