Search:

Type: Posts; User: newbie

Search: Search took 0.14 seconds.

  1. Replies
    10
    Views
    1,979

    [SOLVED] Re: GuessingGame problem

    But it doesn't work perfectly, it will only return true if x is equal to index 99 of W.
    Follow what I wrote and you'll get what you want.
  2. Replies
    10
    Views
    1,979

    [SOLVED] Re: GuessingGame problem

    Oh i see.
    Well that loop currently does pretty much nothing.
    You need to place the if and else statements inside the while loop.

    What's giving you the error is, you're incrementing i from 0 to...
  3. Replies
    10
    Views
    1,979

    [SOLVED] Re: GuessingGame problem

    I'm going to assume you haven't changed much in you're while loop and say the following:
    An array of size 100, has indices ranging from 0 99 inclusive.

    Because you're incrementing i, (i++;)...
  4. Replies
    10
    Views
    1,979

    [SOLVED] Re: GuessingGame problem

    Yeah, that would be what you're after.
    Also consider replacing the while loop with a for loop, it's more convenient than storing a counter variable yourself.
    Of course it will function exactly the...
  5. Replies
    10
    Views
    1,979

    [SOLVED] Re: GuessingGame problem

    if(i<w.length) //if found
    return true;


    Think about that for a minute, what you're essentially saying is...
    If 1(and upwards) is less than 1000, return true.

    How does 1 being less than...
Results 1 to 5 of 5