Here is my working code. However, one small problem. I cannot seem to input in the right answer. The code always only repeats "Incorrect. Wrong answer..." even if I input the right answers which are "slowbro", "Slowbro", and "SLOWBRO". I would be very thankful if someone can help me fix the following code:
public void PokemonQuiz ()
{
char again = 'y';
while (again == 'y' || again == 'Y') {
String ans = IBIO.inputString ("\nUnscramble: OBORSLW (Hint: Shelder latches onto its tail.) ");
int tries = 0;
while (ans != "slowbro" || ans != "Slowbro" || ans != "SLOWBRO") {
System.out.println ("Incorrect. Wrong answer. Try again.");
tries++;
ans = IBIO.inputString ("\nUnscramble: OBORSLW (Hint: Shelder latches onto its tail.) ");
if (tries > 3)
{
System.out.println ("The correct answer was SLOWBRO.");
again = IBIO.inputChar ("Play again? (y/n) ");
if (again != 'y' || again != 'Y')
break;
}
}
System.out.println ("Correct.");
}
Edit: I know that "==" should be replaced with ".equals ()" but then how would i change the "!=" ??