Share your repls and programming experiences

← Back to all posts
Java Number Guessing Game
GamrCodr (6)

Java guessing game which produces a random number from 1 to 100. I tried to write this code in as few lines as possible. I am still fairly new to Java so if you notice something I could do better then please tell me! Have fun!

ZachariahSawye1 (1)

This could be used as a "trainer" for people to get a better understanding of a Binary decision tree.

You could expand this project by creating random range of numbers and letting the user know in advance the optimal guesses. Have the range be 2^n, where n is a small range of numbers.

RolandGuerriere (0)

Some how my first guess was fifty and it told me to go lower. After trial and error the number was 72???

Goldmund (0)

Looks good, but if i were you i would put a number of attempts (8 for example).