Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean processGuess(String guess)
- {
- //TODO: Activity 3
- String newGuess = "";
- String newNewGuess = "";
- for (int i = 0; i < guess.length(); i++)
- if (!(guess.substring(i, i+1).equalsIgnoreCase(" "))) {
- newGuess += guess.substring(i);
- i = guess.length();
- }
- for (int i = newGuess.length(); i > 0; i--)
- if (!(newGuess.substring(i-1, i).equalsIgnoreCase(" "))) {
- newNewGuess += newGuess.substring(0, i);
- i = 0;
- }
- System.out.println(newNewGuess);
- if (newNewGuess.equalsIgnoreCase(celebGameList.get(0).getAnswer())) {
- celebGameList.remove(0);
- if (celebGameList.size() == 0)
- return true;
- else {
- gameCelebrity = celebGameList.get(0);
- processGuess(guess);
- }
- }
- else {
- System.out.println(false);
- return false;
- }
- System.out.println(true);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement