Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: Hello

  1. #21
    evant is offline Member
    Join Date
    Dec 2009
    Posts
    33
    Rep Power
    0

    Default

    Right sorted it...i just put this after the else bit of the code

    if(this.getPosition() == position)
    {
    this.jump();
    }

    anyone had any luck with the select runners bit??

  2. #22
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default

    Hi evant

    i havent got that line in my code

  3. #23
    evant is offline Member
    Join Date
    Dec 2009
    Posts
    33
    Rep Power
    0

    Default

    If you look at the first post in this thread from Aggy, the code is right apart from the > should be a <

    im still struggling with the selection bit. cant get the code right for when two frogs need selecting, getting fed up of it now

  4. #24
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default

    Hi Evant

    The line that you have given in your reply is not in the piece of code given by aggy

  5. #25
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default

    Hi evant

    Put that line at the end of the else loop but it comes up with the error, when looking at the line " if(this.getPosition () == position)
    {
    this.jump
    }
    position has private access in frog

  6. #26
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default Return Methods

    Hi

    Hit a stumbling block(one of many!!!!) trying to devise a return methods for three instance variables. However, i seem to be receiving an error message when i try to compile the code.
    Java Code:
    /**
           * Returns the value of racingFrog instance variable.
           **/
          public int getRacingFrog1()
           {
              return this.racingFrog1();
           }
    
           /**
    comes up with the error "cannot find symbol-method racingFrog1()2

  7. #27
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default prepareForRace

    Hi Everyone, has anyone got to the prepareForRace section?
    I have but think that a few things previous is wrong, can't seem to get the selected to to do anything!! any idea's from anyone?

    Cheers Oli

  8. #28
    darkblue24 is offline Member
    Join Date
    Jan 2010
    Posts
    36
    Rep Power
    0

    Default

    Hi guys

    I need help with constructing selectRunners() method.
    Any hints? I am working on that for past 2 days in "Help with assigment needed" thread and I spend so much time on constructing an array when I just find out that it should not be an array there. What sort of loop did you used there?

    Cheers

  9. #29
    Aggy is offline Member
    Join Date
    Jan 2010
    Location
    England
    Posts
    15
    Rep Power
    0

    Default

    After much thought I ditched my code and re-read all the course work books, and having got no where I brought the "idiots guide to java" and have now managed to actually solve the problem and get it to work.

    you need to make a while loop that checks how many runners are in the race and then a nested if statement to check to see if the frogs are actually running and then a check at the end to see if there are more than 2 runners to start the race.

    and it helps to create a boolean selected instance for the racingfrog class.

  10. #30
    evant is offline Member
    Join Date
    Dec 2009
    Posts
    33
    Rep Power
    0

    Default

    Hi Oli, i am just about to start that bit. Think we spoke on here about the last TMA lol... how you getting on?

Page 2 of 2 FirstFirst 12

Posting Permissions

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