...especially because if you actually try to use (int)(random(-1,1)) the only value that ever comes out is 0:
Code:
for (int i=0; i<100; i++){
println( (int)(random(-1,1)) );
}
(int) always rounds towards zero, which is a tricky gotcha - there was a bug in the core a while back because (int) was being used to round floating point values for pixel-based clipping, and it was very subtle because it only worked incorrectly when the floating point value was between -1 and 0.
You could either use Ben's suggestion, or floor(random(-1,2)) to get what you want. I like floor because it explicitly acknowledges what you're trying to do.
I don't know that I agree about removing the ranged version, I find it very useful whenever I need a random floating point value. What I might agree with is decoupling the Processing random() function from the Java implementation, which in my opinion is crummy and slow, like most built in random functions in programming languages...(actually, I feel this way about a lot of the Math.* functions, for that matter - I encourage you to actually try writing the obvious versions of simple math functions and comparing the performance versus the Math.* versions, you might be surprised! Some of this is because Math.* uses doubles instead of floats, so you end up with a cast in and a cast out, but I suspect some of it is that Java's core developers have never taken mathematical speed to be very important, always preferring a slow, correct, and simple math library to a fast or complete one).