Results 1 to 2 of 2
  1. #1
    jman8910 is offline Member
    Join Date
    Jan 2013
    Rep Power

    Question 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?

    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!");
    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

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Having a problem with my code

    Quote Originally Posted by jman8910 View Post
    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.


    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. I'm not sure where there is a problem with the code...
    By Blondedude092 in forum New To Java
    Replies: 5
    Last Post: 10-01-2012, 12:24 AM
  2. Problem in code
    By Pojahn_M in forum New To Java
    Replies: 12
    Last Post: 06-06-2011, 12:12 AM
  3. Problem with code
    By koryvandell in forum New To Java
    Replies: 4
    Last Post: 04-25-2011, 04:28 AM
  4. Replies: 0
    Last Post: 02-21-2011, 11:50 AM
  5. Replies: 9
    Last Post: 09-21-2010, 04:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts