阅读背景:

随机数生成器问题 - Android Studio

来源:互联网 

I have a random number (loadG1) that is outputted after the user presses enter on an EditText. I added a few if statements near the end of the timer to ensure that a number of specific digit length is outputted depending on the user's score. They get a point added each time their input matches loadG1. My problem is that sometimes on the outputted randoms before 3 points (>=0), I get a six digit number. This is only meant to happen when they have 3 or more points. This also happens at other stages, e.g: 7 digits meant to be outputted by 8 are instead. The pattern seems to almost work perfectly, but at times one digit more than the limit is outputted for that user's score. Never one digit less, but either the right amount or sometimes one more.I have a random number (loadG1) that is outputt




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: