Ken,
Yes, I have separate agents for the raindrops and I am using send-
off ... Here is the code bit:
(defn make-it-rain [g num-raindrops]
(let [rainagents (vec (repeat num-raindrops (agent nil)))]
(dorun
(pmap
#(send-off % draw-raindrop-fall g (rand-nth (range 0 500)))
rainagents))))
On Apr 3, 5:15 pm, Ken Wesson <[email protected]> wrote:
> On Sun, Apr 3, 2011 at 5:10 PM, carinmeier <[email protected]> wrote:
> > I am experimenting with Java Graphics and Clojure. I made a Gist that
> > draws a frame with some text, grass and raindrops falling. I made a
> > function that draws a raindrop falling and I created agents to send
> > off the drawing of the raindrop. I then called pmap to send-off the
> > agents to the draw-raindrop function. The problem is, that I can't
> > seem to get more than one raindrop falling being drawn at one time.
> > If anyone could help me understand whether what the problem is, I
> > would appreciate it.
>
> >https://gist.github.com/900809
>
> > Wishing for parallel raindrops and May flowers.
>
> Do you have separate agents for each raindrop? And are you using
> send-off rather than send?
--
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