Today I was working on Codecademy, I am working on a simple choose your own adventure at the moment and this is what I have so far:
var user = prompt("Who do you choose as your side ally? \
Cascade, KittyBoy, Falls, or Shock?").toUpperCase();
switch(user){
case 'CASCADE' :
console.log("You have picked Cascade! This is a fire type starter Tres.");
var area = prompt("On a scale from 1-10 (1 being none, 10 being lots)\
how much experience do you have with Tres?");
if(area > 10) {
console.log("That number is too large, please try again.");
}
else if (area <= 5) {
console.log("alright, we'll start with something simple for training!");
} else if (area >= 5){
console.log("Ah, played before? We'll just do a quick refresher!");
} else {
console.log("That number is either too large, or too small, please try again.");
}
break;
case 'KITTYBOY' :
console.log("You have picked KittyBoy! This is a blood type starter Tres.");
var area = prompt("On a scale from 1-10 (1 being none, 10 being lots)\
how much experience do you have with Tres?");
if (area > 10) {
console.log("That number is too large, please try again.");
}
else if (area <= 5) {
console.log("alright, we'll start with something simple for training!");
} else if (area > 5){
console.log("Ah, played before? We'll just do a quick refresher!");
}
break;
case 'FALLS' :
console.log("You have picked Falls! This is a water type starter Tres.");
var area = prompt("On a scale from 1-10 (1 being none, 10 being lots)\
how much experience do you have with Tres?");
if (area > 10){
console.log("That number is too large, please try again.");
}
else if (area <= 5) {
console.log("alright, we'll start with something simple for training!");
} else if (area > 5){
console.log("Ah, played before? We'll just do a quick refresher!");
}
break;
case 'SHOCK' :
console.log("You have picked Shock! This is a lighting type starter Tres.");
var area = prompt("On a scale from 1-10 (1 being none, 10 being lots)\
how much experience do you have with Tres?");
if (area > 10) {
console.log("That number is too large, please try again.");
}
if (area <= 5) {
console.log("alright, we'll start with something simple for training!");
} else if (area > 5){
console.log("Ah, played before? We'll just do a quick refresher!");
}
break;
default :
console.log("I'm sorry, that was not one of the options.");
}
No comments:
Post a Comment