Zax63
Illuminator
The goal is to get a random number between -20 and 20. ball1Velocity is a CGPoint.
Produces a positive number up to 20 or 4294967296.
This seems to work properly.
Am I doing something wrong in the first one?
Code:
ball1Velocity.x = (arc4random() % 21) - 10;
Code:
ball1Velocity.x = (arc4random() % 21);
ball1Velocity.x -= 10;
Am I doing something wrong in the first one?

