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
Disassembling C++ Part 2 -- Objects
What is an object? This article is part two of my Disassembling C++ series. The first one was here about overloaded functions, and mang...
Sunday, January 21, 2018
Subscribe to: Post Comments (Atom)
In todays world, one of the common things is to be able to serve SOAP requests. As an enterprise grows, the need for fast response times an...
When creating new C++ classes, especially as a beginning programmer, you can end up with a mess that is barely more than a bunch of function...
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...
Post a Comment