Having a problem with my code
Hello all!
I am new(as in started a few days ago), to Java, and I have been using this really neat website called Moderator edit: site name removed
I have gotten through most of the "Introduction to Javascript" section, but am stuck in the "asking for feedback" lesson of this section.
could someone PLEASE PLEASE PLEASE tell me what the problem in my code is? everything is working, except no matter what I do, I get the "I slaved away at this game and you rate it that?!" console.log part. could someone PLEASE help?
thanks!
my code is below.
confirm("I am ready to play!");
var age =
prompt("What is your age?");
if( (age) <= 18)
{
console.log ("You can play, but I take no responsibility");
} else
{
console.log("Good Luck!");
}
console.log ("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him. ");
console.log ("Batman glares at you");
var userAnswer =
prompt("Are you feeling lucky, punk?");
if( (userAnswer) === ("yes"))
{
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
} else
{
console.log ("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.");
}
var feedback;
prompt("rate my game out of 10");
if ((feedback)<= (8))
{
console.log("This is just the beginning of my game empire. Stay tuned for more!");
}
else
{
console.log("I slaved away at this game and you gave me that score?! The nerve! Just you wait!");
}
Re: Having a problem with my code
Quote:
Originally Posted by
jman8910
I have gotten through most of the "Introduction to Javascript" section
This is a Java forum. JavaScript is not Java.
Closing this off topic thread and it will be removed later.
db
THREAD CLOSED