How would one make an if statement that would take user input and then take that word I asked them to use and choose between either the uppercase or lowercase version and still run the same line of code?
import java.util.Scanner;
//text game practice
public class textGame {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int goblin;
int troll;
int spider;
System.out.println("Would you like to play as the Mage, Warrior, or Rouge?");
String line1 = scan.next();
System.out.println("Okay " + line1 + " what is your name?");
String name = scan.next();
if (name.equals("Mage" || "mage")) {
System.out.println("You are a mage named " + name + " from a small wizardry school in the north.");
}
if (name == "Warrior" || "warrior") {
System.out.println("You are a warrior named " + name + " fresh out of the new cadets at the Gambleton Outpost.");
}
if (name == "Rouge" || "rouge") {
System.out.println("You are a rouge named " + name + " you were trained by petty theives in the streets of Limburg.");
}
else {
System.out.println("You did not answer the question correctly please try again.");
}
}
}