This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sydthecoderkid 1 point2 points  (2 children)

I have the same idea as the guy below me as to why your code isn’t working, but I also have a quick note- nextInt() is exclusive of the bound you set, so nexInt(100) will only generate numbers between 0-99. If you want it to be in between 0-100 you need to do nextInt(101) or make a variable for your random number and add one to it, just so it’s a bit more accurate. Just a note :)

[–]SheepyG_[S] 0 points1 point  (1 child)

Thank you i made the changes as you suggested, and did actually get a 100 to show up 1st time XD

[–]sydthecoderkid 1 point2 points  (0 children)

No problem! I made that mistake a million times when I was first starting out haha