![]() |
|
[Java] Java HiLo Program - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] Java HiLo Program (/showthread.php?tid=4993587) |
Java HiLo Program - NebbieSwims - Sep 19, 2015 I just need some help on one part of my program. I'm supposed to write a task that will tell the user to guess a num and if it's higher than the random generated num then tell the user, lower, and so on... until the user get's it right. I was able to do this fine, but for some reason the while statement is not executing the "You're way too high" or "Way too low" statement when the user is above/below 25 of the num. Any ideas? PHP Code * - clrlslwi - Sep 19, 2015 Swap the comparisons around. Code else if (cornum > (num+25))Goes above Code else if (cornum > num)Same with the low comparisons. * - NebbieSwims - Sep 19, 2015 (Sep 19, 2015 06:09 PM)Demmonic Wrote: Swap the comparisons around.Thanks you very much, I think it works now. |