if (rand.nextDouble() < 0.1) ballSize++;
Pretty simple, I guess. The ballSize is an int set at 10, and it gradually gets bigger infinitely. We're supposed to cap it to an arbitrary number, and while I can manage to make it stop increasing at a certain int, I can't figure out how to reverse the operation and have it start counting back down. All I could think of something like:
if (ballSize == 100) ballSize--;
But obviously that won't keep making it decrease. Can anyone try and lead me to the right direction?