You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a player guesses the puzzle by entering the movie name, always shows Incorrect.
This is because, keyboard.next() -> takes in only the first Word entered before giving a space
Example:
Input: The Secret Life of Bees
Output: The
Here is the code:
System.out.print("Please Enter Your Guess: ");
keyboard = new Scanner(System.in);
String playerGuess = keyboard.next().trim();
Change that needs to be done:
keyboard.nextLine().trim()
The text was updated successfully, but these errors were encountered:
When a player guesses the puzzle by entering the movie name, always shows Incorrect.
This is because,
keyboard.next()
-> takes in only the first Word entered before giving a spaceExample:
Input: The Secret Life of Bees
Output: The
Here is the code:
Change that needs to be done:
The text was updated successfully, but these errors were encountered: