The user should start by guessing the most occurring letters in the word which are vowels( a, e, i, o, u). The player wins the game as soon as all the letters of the word have been guessed correctly. If the letter isn’t present in the word then the number of lifelines is reduced (which consists of finite no. If that letter is present in the word then the program will replace the dashes with the letter at every place it appears. So, the output screen will display the number of dashes representing the letters left to be guessed. This game is for beginners learning to code in Java and to give them a little brief about using strings, loops, and conditional statements.Ī word has to be guessed by the player. nextInt(), a function, is used in this article’s code. Java has dedicated an entire library to Random numbers seeing its importance in day to day programming. Java is a general-purpose computer programming dialect that’s concurrent, class-based, object-oriented, and particularly designed to have as few dependencies as possible.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |