Page 2 of 2 FirstFirst 12
Results 31 to 35 of 35

Thread: What is wrong with this code (C++)

  1. #31
    Time Lord Member The_Doctor's Avatar
    Join Date
    Oct 2004
    Location
    The TARDIS
    Posts
    2,040

    Default Re: What is wrong with this code (C++)

    Great, I will try it tomorrow.

  2. #32
    Dragonslayer Emeritus Senior Member Sigurd's Avatar
    Join Date
    Nov 2002
    Location
    Norge
    Posts
    6,877

    Default Re: What is wrong with this code (C++)

    Quote Originally Posted by Blodrast
    edit: even though my code was indented, the board ignores that
    guessed_chars_so_far = 0;
    while (guessed_chars_so_far < strlen (wtbg))


    {
    boolean guessed = false;
    while (guessed == false)


    {
    cout << "Guess character in position " << guessed_chars_so_far << endl;
    cin >> c;
    if (c == wtbg[guessed_chars_so_far])
    {

    cout << "Correct !" << endl;
    guessed = true;
    guessed_chars_so_far ++;

    }
    else


    {
    cout << "Wrong guess, let's try again " << endl;

    }

    }

    }


    ------------------------------------------------------------------
    Like this? ...
    Status Emeritus

  3. #33

    Default Re: What is wrong with this code (C++)

    gasp!
    what is the secret ?! It took me longer to indent the stuff than it took to write the damn thing...
    Therapy helps, but screaming obscenities is cheaper.

  4. #34
    Time Lord Member The_Doctor's Avatar
    Join Date
    Oct 2004
    Location
    The TARDIS
    Posts
    2,040

    Default Re: What is wrong with this code (C++)

    Update:
    It works!!! (well more or less)

    There are a few bugs to work out, I should be able to work these out by myself, if I can't there is always you guys.

  5. #35

    Default Re: What is wrong with this code (C++)

    great, good to hear :)
    Therapy helps, but screaming obscenities is cheaper.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO