I would like to present to you my Four-in-a-row game.
The interesting point (I believe) is the simple way the interface communicates with the engine. The engine is a console application. It receives a string as parameter, which is the history of the game (a sequence of characters from "1" to "7"). The program returns its move, using the same convention, and closes.
So, if someone would to develop his own engine, without wasting time to make an interface, he could easily reuse that one. The package contains also code to make an engine play against another a given number of games.
Here is an example. It's an engine that plays random (but legal) moves. I use it to test the strength of my main engine.
Code: Select all
DIM g AS tGrid
DIM e AS tEngine
IF g.Fill(COMMAND(1)) THEN ' The engine initializes its internal grid from the string received as parameter
PRINT STR(e.Move1(g)) ' It returns its move...
PRINT "0" ' or it returns 0 if the string was unvalid.
Thanks to dodicat for his cairo DLLs and examples.
The latest version of the game uses the Velena engine by Giuliano Bertoletti.