On 09/08/12 11:17, Jim - FooBar(); wrote:
On 09/08/12 10:08, Stathis Sideris wrote:
How about drawing all the rectangles with .fillRect() <http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#fillRect%28int,%20int,%20int,%20int%29> and before each call alternate between black and white by calling .setColor() <http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html#setColor%28java.awt.Color%29>. You can alternate between the colours by taking the first of the following seq every time you set the color:

(cycle [java.awt.Color.black java.awt.Color.white])

Stathis

Geia sou Stathi,

If I understood correctly, you propose filling rectangles instead of drawing lines...that is a good idea but how would I alternate the colors using 'cycle'? 'cycle' returns a infinitely cycled lazy-seq of the provided collection. Whenever i call 'first' on it I get the same value back...they are not alternating! Have I misunderstood? thanks for bothering btw... :-)

Jim (Dimitris)


aaa ok sorry...you mean having it as doseq binding...that makes sense! I apologise for rushing...

Jim

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

Reply via email to