Sunday, 12 October 2008

Tic Tac Twiddling

With the Game of Life simulation mostly finished, I today started a new mini-project: making a Tic Tac Toe game in SDL. This will be a player-versus-computer affair when it's completed, and has a spiffy hand-drawn look to it:



So far I've finished the GUI (as you may have noticed) and most of the logic. The turns system is implemented, the player and computer can both insert their respective symbols, and it can tell if someone has won. All that's missing is the computer AI that puts in its pieces (which is why there are no crosses in the above image - the computer doesn't actually do anything during its turn yet). The next step is to try and work out an algorithm for determining which move to make each turn, and ultimately try and make the computer unbeatable. It should prove somewhat challenging, at best...

UPDATE
It's finished! The source code is available here.

5 comments:

  1. have you given up slipslide or have just been really busy with sdl and c++?

    ReplyDelete
  2. Nope, of course not; Slipslide is still in the works - I'm currently working on making all the level backgrounds.
    Admittedly, it's progress has slowed down a fair bit now that I'm learning C++, but I'll never completely give up - painting the level backgrounds is the only hard part, the rest is all easy now :-)
    I notice I haven't posted anything about it however, so I'll try to remedy that by posting a few of the levels soon.

    ReplyDelete
  3. I bet you've already switched to pygame after struggling with C++. =) Very nice illustration of idea. It would be even more cool if circles and crosses were drawn dynamically.

    ReplyDelete
  4. do you have the source code for this ?

    ReplyDelete
  5. Yes, the source code is available here:
    http://www.pasteall.org/6660/cpp
    It's actually finished, I never got around to updating the post :P I'll do that now...

    ReplyDelete