Hi,
Some time back Lau Jensen blogged something like this. Its starts here
http://www.bestinclass.dk/index.clj/2009/10/brians-functional-brain.html
but there are at least two follow ups. It might spark inspiration if you've
not yet read it.
Edmund
On 22 Jul 2010, at 13:37, Rising_Phorce wrote:
> I'm coming from an imperative background and trying to stay away from
> "for loops" to do the task at hand. Given a size, I want to create a
> vector of vectors to represent a game board similar to Rich's ants or
> Conway's Game of Life (no wrapping necessary for me). A couple of
> questions. I will need to traverse the vectors sequentially but at
> each step there will be lots of sequential back and forward tracking.
> Arrays would be the natural imperative choice, but the docs recommend
> this only for inter-op. So are vectors the best choice?
>
> Secondly, I figured out how to create a row (a vector of length
> 'size'): (defn make-row [size] (vec (take size (repeat nil))))
>
> but I can't figure out how to conj 'size' calls to make-row onto
> another empty vector.
>
> I've tried 'map', but then I need a data structure of length 'size' to
> iterate
>
> I've looked at 'doTimes', but haven't been successful in figured out
> how to make it work for this.
>
> Thanks.
>
> --
> 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
--
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