Results 1 to 2 of 2
Thread: Having a problem with my code
- 01-15-2013, 08:55 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 1
- Rep Power
- 0
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!");
}Last edited by DarrylBurke; 01-15-2013 at 09:34 PM. Reason: Removed plug for website
- 01-15-2013, 09:33 PM #2
Similar Threads
-
I'm not sure where there is a problem with the code...
By Blondedude092 in forum New To JavaReplies: 5Last Post: 10-01-2012, 12:24 AM -
Problem in code
By Pojahn_M in forum New To JavaReplies: 12Last Post: 06-06-2011, 12:12 AM -
Problem with code
By koryvandell in forum New To JavaReplies: 4Last Post: 04-25-2011, 04:28 AM -
C server code - Java CLient Code _ TCP Connection Problem
By rmd22 in forum NetworkingReplies: 0Last Post: 02-21-2011, 11:50 AM -
Can anyone see the problem with my code? problem understanding switch (newbish)
By keith in forum New To JavaReplies: 9Last Post: 09-21-2010, 04:15 PM


LinkBack URL
About LinkBacks


Bookmarks