A Java console game where one player enters a secret word, the letters are shuffled randomly, and another player has 7 attempts to guess the original word.
- Randomly shuffles the letters of any word
- Supports hidden word input when run from a terminal
- 7 guessing attempts per game
- Displays the remaining attempts after each incorrect guess
- Player 1 enters a secret word.
- The program shuffles the letters randomly.
- Player 2 sees only the scrambled word.
- The player has 7 attempts to guess the original word.
- If the word is guessed correctly, the player wins.
- If all attempts are used, the correct word is revealed.
- Java
- Collections Framework (
Collections.shuffle()) - Console API (
System.console())
Compile:
javac WordScrambler.javaRun:
java WordScrambler