Sign in to follow this  
somebodys_life

Where next?

Recommended Posts

Right now I am learning C++, I have already gotten a book, and I am currently doing the exercises in it. Right now everything is going fine, I do regular exercises on my own with little to no problems. As of now, I can right the number guessing game with my eyes closed. But I am not really sure where to go from here, so if someone could tell me what would be a good next project it would be helpful. Thanks

Share this post


Link to post
Share on other sites
Just let me make sure I would understand how to do this (more or less).

So I would need to fist set up an array to store the letters in. (I find would be the simplest way to do so). Then I would need to make sure that the player can take turns with the computer? Or does this seems too advanced for me? AI, is something that I'm not quite sure that I'm capable of at this point. If I am not, what yet do I need to learn?

And then I would need to make sure that the program understands when the player wins, and loses. Not to mention, a replay feature, etc.

Correct or no?

Share this post


Link to post
Share on other sites
Yes. Most of what you describe can be done using while loops, just think about how to deal with the problem.

The AI doesn't need to be complicated, you could introduce some randomness and make decisions based upon how many of the player's symbols are in a row. You could start it off as a two player game.

Share this post


Link to post
Share on other sites
ok let me make sure my ideas are correct-

Turns- While p1 turn, ask for variable, after ask for variable, p1 turn = false.
Repeat for 2

Assign arrays for the x/o
But what about making it appear?
cout obviously, but more specificly?

thanks

Share this post


Link to post
Share on other sites
You'll just have to go through each element in your array holding the game data and format it prettily. Here's some pseudocode to get you going:

for (each row)
{
for (each column)
{
cout << Character_Stored_In_This_Row_&_Column
}
cout << "\n"
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this