The illness tracker - finally a good use for AI

 Hi all, so as you may have noticed, there is a new section on the upper nav bar called "Projects". There is only one project righ...

Sunday, January 21, 2018

Qt5 Tic-Tac-Toe

This was a fairly simple tic-tac-toe game.  The logic behind it is that it goes through every available move and sees which square will give the computer the highest chance of winning.  If two or more squares are equal, it just selects one at random.  To build this program, yu will need a C++ compiler and qt version 5 including qmake installed.  The idea between using characters X and O or to do native drawing commands was a tough one, but I finally settled on native drawing to a pixmap that was pretty big and then applied them to the squares.  The squares themselves are buttons, so that made the event system a lot easier to use.

Get source from here: https://github.com/beneschtech/qt5-tictactoe

1 comment:

  1. Playing this requires very careful planning; one mistake and you'll have to accept defeat. It's not as easy to play as FF Beta APK
    .

    ReplyDelete