C++ Practice: Tic Tac Toe

Image from this fine location

This was another small(ish) task that Jamie suggested would be good exercise and yes, it was. This is related to my ‘Learn to code in C++’ SMART goal and supplements the course that I have been taking on Udemy. So the idea was that I would create a simple console version of noughts and crosses that could be played in two modes. Easy, in which the computer would choose a random square based on the ones that were empty and Hard, in which the computer would seek to actively block the player usually leading to a draw, just like in real life. I wont show all of the program, includes, menu display functions and such, just the main function and the more important functions so as to illustrate the structure I went for. I wont be posting code like this in the future unless someone finds it useful as I dont think that the journal is really about that. I think that in the future I will post about the things I am finding challenging and what I am doing about that. I’m posting this because, if I’m honest, I’m kinda proud of this one. It took a while to get it all straight in my mind and it was a really worthwhile thing for me to do.

This is what I can up with…

1 of 2
2 of 2

I enjoyed this task and I learned a lot. I think that the next task is the Unreal Battery collector tutorial as I think I am ready to start learning about Unreal’s flavour of C++.

Leave a comment