Closed kjkuan closed 10 years ago
What about the code isn't working as expected? What happens instead?
I'm guessing you're getting an error, because x
and y
start out as int
s in this chapter. Yet random(-1, 1)
returns a float
, so make sure you've changed x
and y
to float
s.
I checked and the text explicitly mentioned the need for floating points so I think this issue can be closed.
In the Introduction page, I find that the use of
random(-1, 1)
doesn't work as expected without rounding. I think it should be used like this:Note: I'm using Processing 2.0.2 on Mac OS X.