Lucky Number Guessing Game in Java using Eclipse IDE
In this tutorial, you will learn the following:
- How to accept value from the user using the Scanner Class
- How to generate random numbers from 1 - 6
- More insight on the do while loop in Java
You would need the following inorder to following this tutorial:
- An Integrated Development Environment(IDE) installed that can run Java (e.g Netbeans, Eclipse)
- JDK 1.X installed on your Pc
- Of course willingness to learn
Difficulty
- Intermediate
Description
A simple guessing game is created, where the user guesses a randomly generated number.
Firstly, a scanner object is being used to receive the value from the user and then a random number is being generated, these two values are checked against each other and if the user gets the correct answer then the loop exist but if not, the loop continues.
The user can either enter 0 to quit the game or have Five(5) chances to guess the lucky number.
Video Tutorial Link:
Curriculum
Below is a list of related videos that will make you understand this better!
NB: This video has only being shared on my Youtube Channel
Tutorial codes can be gotten from this Github repository: https://github.com/generalkolo/Javacodes
Posted on Utopian.io - Rewarding Open Source Contributors

@originalworks
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thanks, @creon
Hey @edetebenezer I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x