Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Help with task

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with task

    The following code is an unfinished example of a guess the number game. The user may continue to guess until the correct number is given. Your task is to write the code that is missing for the game to work.

    function game() {
    this.number = Math.floor(Math.random() * 10);
    this.gameState = true;

    this.play = function() {
    while(this.gameState == true) {
    this.guess = prompt("Enter a number:");
    // DIN KOD HÄR
    }
    }
    }


  2. #2
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Help with task

    This looks like a java script program and not a java program.
    These 2 are not the same and this is a java help forum.

  3. #3
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with task

    Yeah okey then, even if its not java programing if you can help me out with this i would be grateful!
    best regards.

  4. #4
    Junior Member
    Join Date
    Jul 2014
    Posts
    15
    My Mood
    Cold
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with task

    Your task is to write the code that is missing for the game to work.
    That just tickles me the wrong way, is this for school? Shouldnt you be writing the code?

  5. #5
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: Help with task

    People would be inclined to aid you if this was a Java program.
    Since it's JS - you may want to try your luck on a JS forum
    instead.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  6. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help with task

    Thread moved.

Similar Threads

  1. [SOLVED] Need a little help,easy task
    By eyalfish in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 23rd, 2014, 02:08 PM
  2. Need help with home task.
    By clyxee in forum Totally Off Topic
    Replies: 2
    Last Post: December 6th, 2013, 03:26 AM
  3. Java Task
    By frictionmind in forum Java Theory & Questions
    Replies: 0
    Last Post: July 21st, 2013, 01:12 PM
  4. Need Help With My Task
    By pumpkins in forum What's Wrong With My Code?
    Replies: 7
    Last Post: May 24th, 2013, 04:02 AM
  5. task manager
    By sayed shah in forum Object Oriented Programming
    Replies: 1
    Last Post: April 27th, 2012, 04:15 PM