Game – Tic Tac Toe

As my first project when I went to start learning C and C++, I wanted to start simple, I wanted something I could finish and I wanted something that might be fun =)

The first thing that came to my mind was a game I had played on school that day, “Tre på rad” as it’s called in Norway, and Tic Tac Toe as it’s called in English.

For those who don’t know, the goal of the game is the get three X’s or O’s in a row.


Making the game itself was actually kind of easy, since I allready had experience in general game flow and programming from programming GML(GameMakerLanguage). I used an example file I found on the net to add colors, and after and hour had a first version ready.

The only problem I had was the input, I wanted it to be able to input the coordinates like this: ‘1,2’, but at that time I had noe idea how to go about this, and ended up with taking the input two times, once for the X-coord, and once for the Y-coord.

After I finished the first version, and I was happy with myself, I figured I’d try to expand it a little.


I added the abbility to use larger game boards, giving you 3X3, 6X6 and 9X9 boards. I also wanted to add an AI, but figured it was way beyond my ability at that time, and that I’d rather go on to something else.

When I first gave this out at the Norwegian Nintendo forums, I got ok response and ended up giving out the source. As soon as I gave out the source, I got a message about how ugly my code was. I couldn’t argue on that, as it was my first project I ended up adding, removing and moving my code to test things, and to make it work like I wanted it to. Never did I think bout making the code readable to others. After my webhost went down I lost the source for this game, but I did not actually miss it as I now know how ugly and bad code I really had written.

I managed to save the EXE, and can give it out here to anyone who still want’s to play it 🙂

Download EXE: RarZip

NOTE: If the file for some reason isn’t there, send me a mail or a message, and I will upload it again. I hope to get my own host for files soon.

EDIT 02/08/2008:
Fixed the download links.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: