I'm not sure what this means....but if you have a function that you feed a number N and it returns a value between and including 0-N, how would you get it to return a value between 0-(N+1)?
Type: Posts; User: copeg
I'm not sure what this means....but if you have a function that you feed a number N and it returns a value between and including 0-N, how would you get it to return a value between 0-(N+1)?
Break apart the equation and have a look at the API for the Random.nextInt function you use - it returns a value between (and including) 0 and the parameter value (excluding that value). So, doing...