Section 2 Screenshot

Here’s my code:

int main(int argc, const char * argv[]) {
    // introduce the game
    constexpr int WORD_LENGTH = 9;
    std::cout << "Welcome to Bulls and Cows, a fun word game!" << std::endl;
    std::cout << "Can you guess the " << WORD_LENGTH << " letter isogram word that i am thinking of?" << std::endl;
    
    // get a guess from the user
    std::cout << "Enter guess: ";
    std::string Guess = "";
    std::cin >> Guess;
    // repeat the guess given by the user
    std::cout << "You entered: " << Guess << std::endl;
    return 0;
}

For this lesson i followed along, however the only difference i used was what i thought was best practice by not using the namespace above. Even though it makes it easier, i wanted to get in the habit of not importing a big library like that just in case later there are conflicts.

Thanks, Enoch.

Your work, I think, is very neat and tidy. Inspiring.

Cheers,
Jacques Retief

1 Like

Thank you Jacques!! :slight_smile:

1 Like

Please advise me how to format code in forums as you have, Enouch?

cut a paste and mode and change it. How may we use this technology in 3 dimension convert 5.?

Hey Jacques!

If you copy and paste your code over to the discussion, you can highlight what you pasted and in the menu select the </> icon. That will put it in a code snippet :). Hope this helps!

Cheers!
Enoch

Privacy & Terms