Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Players Guess are always Incorrect #2

Open
syedalisait opened this issue Nov 17, 2018 · 1 comment
Open

Players Guess are always Incorrect #2

syedalisait opened this issue Nov 17, 2018 · 1 comment

Comments

@syedalisait
Copy link

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()

@syedalisait
Copy link
Author

syedalisait commented Nov 17, 2018

@Makhubele-B - Here is my pull request Player Guess Bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant