System.out.println("Ho Ho Ho! What's your name?");
name = scan.nextLine;
//On multiple lines for spacing reasons
if(name =="Giny"|| name =="Kamile"|| name =="Leah"|| name =="Leyla"|| name =="Harriet"|| name =="Saijal"|| name =="Noye"|| name =="Sharon"|| name =="Ria"|| name =="Sarah"|| name =="Maria"|| name =="Annie"|| name =="Katrina"|| name =="Vivien"|| name =="Blessing"){
System.out.println("Oh. I had asked for the other class... I guess you'll do.");
cont =False;
}elseif(name =="Who laughs like that?"){
System.out.println("GAME OVER. Way to make Santa feel awkward.");
System.out.println("What on Earth? What are the elves up to? Ow! That one just threw a candy cane at me! That hurt!");
Sleep.thread(4000);
System.out.println("The elves are rebelling! Not the face! RUN FOR IT!!!");
Sleep.thread(3000);
System.out.println("There are dozens of them! They're throwing so many candy canes at us! We're not going to make it.... EVERY SANTA FOR HIMSELF!");
Sleep.thread(3000);
System.out.println("With candy canes falling left, right, and center, maybe I could...");
System.out.println("Should I pick up a handful of the candy? (Y/N)");
choice = scan.nextLine;
//If the user takes the candy it is added to the inventory. If they do not the game ends
if(choice =="N"){
System.out.println("You quickly ignore the candy and get back up to run away. As you stand up a candy cane hits you right in the spleen. Death by candy cane.");
System.out.println("Good choice! You place the candy in your pocket.");
inventory("candy cane");
}
cont =true;
while(cont){
choice = actionMenu();
if(choice ==2){
System.out.println("Wow! You sure are angry! In your Hulk-rage you grab your candy cane and throw it at an elf. It hits him square on his little elf head and knocks him out! Now run for it!");
removeItem("candy cane");
cont =false;
Sleep.thread(3000);
}
if(choice ==3){
System.out.println("Being the coward that you are, you try to save yourself. As you run past "+ removeStudent()+", an elf gets a direct hit with one of his evil candy canes. She's blacked out!");
Sleep.thread(3000);
gameOver();
cont =false;
}
}
System.out.println("Exiting the toy factory, you find yourself in the middle of elf town: The most evil place that ever evil'd!");
Sleep.thread(3000);
cont =true;
while(cont){
choice = movementMenu();
if(choice ==2){
System.out.println("Turning left, you walk in to a brick wall. "+ removeStudent()+" begins to laugh at you. In the process, she slips on the ice, begins to slide down a hill, and falls off a cliff out of sight. Well that's unfortunate.");
cont =false;
Sleep.thread(3000);
gameOver();
}
if(choice ==3){
System.out.println("Turning right, you see the elf horde quickly approaching. You'd best not go that way.");
Sleep.thread(3000);
}
if(choice ==4){
System.out.println("Going straight, you run in to a dead-end. The street is lined with elf huts. Elf huts are like houses, but with really tiny doors.");
Sleep.thread(3000);
cont =false;
}
}
cont =True;
while(cont){
choice = actionMenu();
if(choice ==2){
System.out.println("Being the aggressive person that you are, you make your stand and face the elvish horde as they charge upon you! The elves run straight past, apparently noticing your rather scrawny stature and deciding that "+ removeStudent()+" made a more appealing target. That was the last you saw of them before deciding to run away.");
Sleep.thread(3000);
gameOver();
cont =false;
}
if(choice ==3){
System.out.println("Deciding that facing an army of angry elves isn't what you studied in school, you quickly run in to the nearby elf hut and close the door behind you. Oh, look at that - you've found some gift-wrapping paper!");
Sleep.thread(3000);
inventory("gift wrapping paper");
cont =false;
}
}
//Time to take over!
System.out.println("Our adventure has only just begun! It's time for you to make this game your own! I have set up this code so that you can do all sorts of things. You can give the player morechoices, add in more scenarios, create new items to use, add new sounds, more menu choices,and so much more! I have put in place a system whereby if all your classmates die, the game is over. Think of them as 'lives.' There is a header comment in the code to explain the functions. Have fun - and Merry Christmas!");
Main.java:47: error: bad operand types for binary operator '+'
(inventoryList.get(1)).set(i, ((inventoryList.get(1)).get(i) + 1));
^
first type: Object
second type: int
Main.java:91: error: cannot find symbol
choice = scan.nextLine();
^
symbol: variable choice
location: class Ideone
Main.java:92: error: cannot find symbol
if (choice == 5){
^
symbol: variable choice
location: class Ideone
Main.java:94: error: cannot find symbol
} else if (choice == 1){
^
symbol: variable choice
location: class Ideone
Main.java:97: error: cannot find symbol
return choice;
^
symbol: variable choice
location: class Ideone
Main.java:100: error: cannot find symbol
catch (IllegalValueException y){
^
symbol: class IllegalValueException
location: class Ideone
Main.java:108: error: array required, but ArrayList<String> found
return studentList[0];
^
Main.java:115: error: cannot find symbol
for (i = 0; i < size(inventoryList); i++){
^
symbol: variable i
location: class Ideone
Main.java:115: error: cannot find symbol
for (i = 0; i < size(inventoryList); i++){
^
symbol: variable i
location: class Ideone
Main.java:115: error: cannot find symbol
for (i = 0; i < size(inventoryList); i++){
^
symbol: method size(ArrayList<ArrayList>)
location: class Ideone
Main.java:115: error: cannot find symbol
for (i = 0; i < size(inventoryList); i++){
^
symbol: variable i
location: class Ideone
Main.java:116: error: cannot find symbol
if (inventoryList[i][0] == item) {
^
symbol: variable i
location: class Ideone
Main.java:116: error: array required, but ArrayList<ArrayList> found
if (inventoryList[i][0] == item) {
^
Main.java:117: error: cannot find symbol
if (inventoryList[i][1] > 1) {
^
symbol: variable i
location: class Ideone
Main.java:117: error: array required, but ArrayList<ArrayList> found
if (inventoryList[i][1] > 1) {
^
Main.java:118: error: cannot find symbol
inventoryList[i][1] -= 1;
^
symbol: variable i
location: class Ideone
Main.java:118: error: array required, but ArrayList<ArrayList> found
inventoryList[i][1] -= 1;
^
Main.java:120: error: incompatible types: unexpected return value
return inventoryList[i];
^
Main.java:120: error: cannot find symbol
return inventoryList[i];
^
symbol: variable i
location: class Ideone
Main.java:121: error: cannot find symbol
inventoryList.remove(i);
^
symbol: variable i
location: class Ideone
Main.java:128: error: cannot find symbol
if (size(studentList) < 1) {
^
symbol: method size(ArrayList<String>)
location: class Ideone
Main.java:137: error: non-static variable cont cannot be referenced from a static context
cont = true; //boolean for loops
^
Main.java:144: error: non-static variable cont cannot be referenced from a static context
while (cont) {
^
Main.java:146: error: cannot find symbol
name = scan.nextLine;
^
symbol: variable name
location: class Ideone
Main.java:146: error: non-static variable scan cannot be referenced from a static context
name = scan.nextLine;
^
Main.java:146: error: cannot find symbol
name = scan.nextLine;
^
symbol: variable nextLine
location: variable scan of type Scanner
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:149: error: cannot find symbol
if (name == "Giny" || name == "Kamile" || name == "Leah" || name == "Leyla" || name == "Harriet" || name == "Saijal" || name == "Noye" || name == "Sharon" || name == "Ria" || name == "Sarah" || name == "Maria" || name == "Annie" || name == "Katrina" || name == "Vivien" || name == "Blessing") {
^
symbol: variable name
location: class Ideone
Main.java:151: error: non-static variable cont cannot be referenced from a static context
cont = False;
^
Main.java:151: error: cannot find symbol
cont = False;
^
symbol: variable False
location: class Ideone
Main.java:152: error: cannot find symbol
} else if (name == "Who laughs like that?") {
^
symbol: variable name
location: class Ideone
Main.java:163: error: cannot find symbol
studentList.remove(name);
^
symbol: variable name
location: class Ideone
Main.java:163: error: non-static variable studentList cannot be referenced from a static context
studentList.remove(name);
^
Main.java:169: error: cannot find symbol
for (i = 0; i < 2; i++) {
^
symbol: variable i
location: class Ideone
Main.java:169: error: cannot find symbol
for (i = 0; i < 2; i++) {
^
symbol: variable i
location: class Ideone
Main.java:169: error: cannot find symbol
for (i = 0; i < 2; i++) {
^
symbol: variable i
location: class Ideone
Main.java:170: error: cannot find symbol
Sleep.thread(2000);
^
symbol: variable Sleep
location: class Ideone
Main.java:172: error: cannot find symbol
Sleep.thread(1000);
^
symbol: variable Sleep
location: class Ideone
Main.java:178: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:180: error: cannot find symbol
Sleep.thread(4000);
^
symbol: variable Sleep
location: class Ideone
Main.java:182: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:184: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:187: error: cannot find symbol
choice = scan.nextLine;
^
symbol: variable choice
location: class Ideone
Main.java:187: error: non-static variable scan cannot be referenced from a static context
choice = scan.nextLine;
^
Main.java:187: error: cannot find symbol
choice = scan.nextLine;
^
symbol: variable nextLine
location: variable scan of type Scanner
Main.java:189: error: cannot find symbol
if (choice == "N") {
^
symbol: variable choice
location: class Ideone
Main.java:192: error: cannot find symbol
Sleep.thread(10000);
^
symbol: variable Sleep
location: class Ideone
Main.java:194: error: cannot find symbol
} else if (choice == "Y") {
^
symbol: variable choice
location: class Ideone
Main.java:196: error: non-static method inventory(String) cannot be referenced from a static context
inventory("candy cane");
^
Main.java:198: error: non-static variable cont cannot be referenced from a static context
cont = true;
^
Main.java:199: error: non-static variable cont cannot be referenced from a static context
while (cont) {
^
Main.java:200: error: cannot find symbol
choice = actionMenu();
^
symbol: variable choice
location: class Ideone
Main.java:200: error: non-static method actionMenu() cannot be referenced from a static context
choice = actionMenu();
^
Main.java:201: error: cannot find symbol
if (choice == 2) {
^
symbol: variable choice
location: class Ideone
Main.java:203: error: non-static method removeItem(String) cannot be referenced from a static context
removeItem("candy cane");
^
Main.java:204: error: non-static variable cont cannot be referenced from a static context
cont = false;
^
Main.java:205: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:207: error: cannot find symbol
if(choice == 3) {
^
symbol: variable choice
location: class Ideone
Main.java:208: error: non-static method removeStudent() cannot be referenced from a static context
System.out.println("Being the coward that you are, you try to save yourself. As you run past " + removeStudent() + ", an elf gets a direct hit with one of his evil candy canes. She's blacked out!");
^
Main.java:209: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:210: error: non-static method gameOver() cannot be referenced from a static context
gameOver();
^
Main.java:211: error: non-static variable cont cannot be referenced from a static context
cont = false;
^
Main.java:215: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:216: error: non-static variable cont cannot be referenced from a static context
cont = true;
^
Main.java:217: error: non-static variable cont cannot be referenced from a static context
while (cont) {
^
Main.java:218: error: cannot find symbol
choice = movementMenu();
^
symbol: variable choice
location: class Ideone
Main.java:218: error: non-static method movementMenu() cannot be referenced from a static context
choice = movementMenu();
^
Main.java:219: error: cannot find symbol
if (choice == 2) {
^
symbol: variable choice
location: class Ideone
Main.java:220: error: non-static method removeStudent() cannot be referenced from a static context
System.out.println("Turning left, you walk in to a brick wall. " + removeStudent() + " begins to laugh at you. In the process, she slips on the ice, begins to slide down a hill, and falls off a cliff out of sight. Well that's unfortunate.");
^
Main.java:221: error: non-static variable cont cannot be referenced from a static context
cont = false;
^
Main.java:222: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:223: error: non-static method gameOver() cannot be referenced from a static context
gameOver();
^
Main.java:225: error: cannot find symbol
if(choice == 3) {
^
symbol: variable choice
location: class Ideone
Main.java:227: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:229: error: cannot find symbol
if(choice == 4) {
^
symbol: variable choice
location: class Ideone
Main.java:231: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:232: error: non-static variable cont cannot be referenced from a static context
cont = false;
^
Main.java:235: error: non-static variable cont cannot be referenced from a static context
cont = True;
^
Main.java:235: error: cannot find symbol
cont = True;
^
symbol: variable True
location: class Ideone
Main.java:236: error: non-static variable cont cannot be referenced from a static context
while (cont) {
^
Main.java:237: error: cannot find symbol
choice = actionMenu();
^
symbol: variable choice
location: class Ideone
Main.java:237: error: non-static method actionMenu() cannot be referenced from a static context
choice = actionMenu();
^
Main.java:238: error: cannot find symbol
if (choice == 2) {
^
symbol: variable choice
location: class Ideone
Main.java:239: error: non-static method removeStudent() cannot be referenced from a static context
System.out.println("Being the aggressive person that you are, you make your stand and face the elvish horde as they charge upon you! The elves run straight past, apparently noticing your rather scrawny stature and deciding that " + removeStudent() + " made a more appealing target. That was the last you saw of them before deciding to run away.");
^
Main.java:240: error: cannot find symbol
Sleep.thread(3000);
^
symbol: variable Sleep
location: class Ideone
Main.java:241: error: non-static method gameOver() cannot be referenced from a static context
gameOver();
^
Main.java:242: error: non-static variable cont cannot be referenced from a static context
cont = false;
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
100 errors