I recently started learning C++ on this platform and everything works fine! But 2 days ago I started the function chapter, and after finished it, I have reached the ‘Tic-Tac-Toe’ Project. Since it is pretty different from others projects in the past, I have absolutely no idea about how to start it. I have practiced the concepts of functions, loops and arrays, but I have no idea about how to start this project. The only thing that I did was to create the greetings message.
I don’t want to help me at all, but can you give me some advice about how to face this kind of project and how to think more logical?
One thing to think about when making a Tic-Tac-Toe game in any coding language is the way the game works. The Tic-Tac-Toe board is a 3x3 grid of cells, and on each turn, one of the two players playing will place their token in one of the empty cells. The game ends when a player has a vertical, horizontal, or diagonal line of their token.
If you don’t know where to start, I would suggest trying to store the board. Keep in mind that every row on the board is a “list” of cells, and that C++ can store 2d arrays. A helpful tutorial on 2d arrays can be found here.
Please feel free to message me if you have any more questions.
After 3 days I solved it, following your advice and by reviewing some concepts. Actually programming is more challenging that I thought, but also more easier. Probably I was afraid of not being able to solve the problem and started being stuck. Maybe I should start practicing more and also focus on a single think at a time.
Thanks for your advice!
I’m in the same boat as you and will give this a shot as arrays are going over my head still, albeit you are ahead by the looks of it