PDA

View Full Version : Four-in-a-row for Lazarus



Roland Chastain
12-04-2014, 09:36 PM
Hello!

I would like to present my Four-in-a-row for Lazarus. It uses BGRABitmap (to draw the circles). The AI is a stand-alone executable, which is called each time the computer has to move.

You can change the language and the color of the interface by editing the options.ini file.


[interface]
language=en
palette=gray


Hope you will like it. :)

Best regards.

Roland

AthenaOfDelphi
14-04-2014, 08:56 AM
Hi Roland,

I downloaded this and had a couple of games, not bad :)

I like the interface, no clutter, simple and clean.

I do have a question for you... why is the AI in another EXE? I'm not criticising, I'm just interested in the decisions/reasons behind it.

Roland Chastain
14-04-2014, 04:06 PM
Hi Roland,

I downloaded this and had a couple of games, not bad :)

I like the interface, no clutter, simple and clean.

Hi! Thanks for trying my game.


I do have a question for you... why is the AI in another EXE? I'm not criticising, I'm just interested in the decisions/reasons behind it.

As I am interested in chess programming, I am curious to learn pipes and inter process communication.

Besides, it has some advantages : I can work on another engine, even write it in a different language, and try it at once from my GUI. I just have to edit the options.ini file.

The GUI runs the engine and sends as parameter the history of the current position, a string of characters from '1' to '7'. The engine computes his move, returns it (one character) and closes.

pitfiend
15-04-2014, 03:49 PM
As I am interested in chess programming, I am curious to learn pipes and inter process communication.

Besides, it has some advantages : I can work on another engine, even write it in a different language, and try it at once from my GUI. I just have to edit the options.ini file.

The GUI runs the engine and sends as parameter the history of the current position, a string of characters from '1' to '7'. The engine computes his move, returns it (one character) and closes.

I think you could benefit from a dynamic library instead. Your actual method is cheating prone.

Roland Chastain
15-04-2014, 05:15 PM
I think you could benefit from a dynamic library instead. Your actual method is cheating prone.

Yes, thank you for the advice. Maybe in the next version ?

Roland Chastain
15-04-2014, 08:37 PM
Here is a new version, using a DLL. :)

farcodev
05-07-2014, 03:32 PM
Just tested it, pretty cool :D

Roland Chastain
15-08-2014, 07:31 AM
Just tested it, pretty cool :D

Thank you!

Here is a new version (please see the first post of the discussion).

1317

Thanks to circular (http://www.pascalgamedevelopment.com/member.php?25226-circular) for his piece of code (http://www.developpez.net/forums/d1385641/autres-langages/pascal/telechargez/quatre-ligne-puissance-4-a/#post7929980).