Harbour Chess

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

Post Reply
User avatar
gfilatov
Posts: 1120
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Harbour Chess

Post by gfilatov »

Hello everyone,

I would like to express my sincere gratitude to Marcos Jarrin for implementing this chess game using Harbour and MiniGUI Extended.

It had long been a dream of mine to have a full-fledged chess engine in MiniGUI.

Here is the application's main header and a few screenshots.
I am also attaching the technical documentation and user manual for your reference—in case you are a chess enthusiast like me.

/*
Program : chess.prg — Harbour Chess
Author : Marcos Jarrín · BadaSystem · badasystem.com
Toolchain: Harbour + MiniGUI Extended (Win32) + BCC 32-bit
Version : 2.34 · 13/09/2026
License : MIT (see LICENSE.md)

Purpose
-------
Single-module chess application supporting Human vs Human, Human vs Machine,
and Machine vs Machine. Implements core FIDE chess rules including castling,
en passant, promotion, checkmate/stalemate, claimable 3-fold and 50-move
draws, automatic 5-fold and 75-move draws, and insufficient-material cases.

AI engine: Alpha-Beta search with quiescence, iterative deepening, PVS,
killer/history/countermove ordering, Zobrist transposition table (with
mate-distance normalization and draw-context exact-cutoff suppression),
and a phased evaluation (material, piece-square tables, mobility, pawn
structure). Time-controlled iterative deepening with partial-depth commit
policy (Mode A soft-finish / Mode B full-depth only). Root-parallel
multi-threaded search with worker I/O isolation.

Architecture
------------
GUI (MiniGUI) → controller (DoMove, timers, menus)
→ engine (GenLegalMoves, ApplyMove / MakeMove-UnmakeMove)
Legal-move validation uses the same in-place MakeMove/UnmakeMove path as
search. Search undo state is a compact fixed array; repetition counts are
maintained incrementally. Engine state is a hash mutated in place.
AI search is started by a timer. Root-parallel workers use THREAD STATIC
state and never perform console/logfile I/O (routed via ChessDebugOut).

Encoding: UTF-8 (optional Unicode piece glyphs).
UI strings go through T(cKey); hash reads through _HGetSafe().
*/
start_position.png
start_position.png (18.83 KiB) Viewed 271 times
replay_position.png
replay_position.png (28.14 KiB) Viewed 271 times
final_position.png
final_position.png (26.93 KiB) Viewed 271 times
I hope you have a great time and a wonderful day.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
serge_girard
Posts: 3429
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Harbour Chess

Post by serge_girard »

Thanks Grigory, where can we download?

Serge
There's nothing you can do that can't be done...
User avatar
gfilatov
Posts: 1120
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Harbour Chess

Post by gfilatov »

serge_girard wrote: ↑Sun Sep 13, 2026 3:34 pm Thanks Grigory, where can we download?
Hello Serge,

Here it is. 8-)

Have fun!
Attachments
Chess.zip
Chess application and two manuals
(1.36 MiB) Downloaded 34 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Steed
Posts: 462
Joined: Sat Dec 12, 2009 3:40 pm

Re: Harbour Chess

Post by Steed »

Coincidence of life: I’m working on a very similar project.(Minigui & HMG)
(don´t forget to install chess_alpha_Font inclued in the zip)

CTRL+M: Show the IA Thinking Monitor (Don´t forge to navigate the Analisys tree)
The pieces can be moved using drag and drop.
Chess, with Human vs. Human, Human vs. AI, and AI vs. AI modes.
Theme settings
IA LAB
Tuning LAB
Can Play using external engines
It can compete in UCI mode under Arena.
Play Book with Clasicc Openings
Copy (CTRL+C) and Paste (CTRL+V) FEN Codes:

Code: Select all

example1: 4r1k1/5ppp/8/8/Q7/8/5PPP/4R1K1 b - - 0 1
example2: 8/5pk1/4p1p1/3pP1P1/p1pP1K2/PpP5/1P6/8 b - - 3 52
example3: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
 

[image]
Chess5.gif
Chess5.gif (1.66 MiB) Viewed 204 times

Code: Select all

    ON KEY ESCAPE OF Form_Ajedrez ACTION CancelSelection() // Cancelar selección
    ON KEY CONTROL+Y OF Form_Ajedrez ACTION ( Redo() )
    ON KEY CONTROL+Z OF Form_Ajedrez ACTION ( Undo() )
    ON KEY CONTROL+N OF Form_Ajedrez ACTION ( NewGame() )
    ON KEY CONTROL+E OF Form_Ajedrez ACTION ( ExportFEN() )
    ON KEY CONTROL+I OF Form_Ajedrez ACTION ( ImportFEN() )
    ON KEY CONTROL+P OF Form_Ajedrez ACTION ( ExportPGN() )
    ON KEY CONTROL+O OF Form_Ajedrez ACTION ( ImportPGN() )
    ON KEY CONTROL+G OF Form_Ajedrez ACTION ( SaveGame() )
    ON KEY CONTROL+S OF Form_Ajedrez ACTION ( SaveGame() )
    ON KEY CONTROL+A OF Form_Ajedrez ACTION ( LoadGame() )
    ON KEY CONTROL+L OF Form_Ajedrez ACTION ( LoadGame() ) 
    ON KEY CONTROL+M OF Form_Ajedrez ACTION ( ShowMonitorWindow() )
    ON KEY CONTROL+T OF Form_Ajedrez ACTION ( RunIntegrityTests() )
    ON KEY CONTROL+C OF Form_Ajedrez ACTION ( CopyFENToClipboard() )
    ON KEY CONTROL+V OF Form_Ajedrez ACTION ( PasteFENFromClipboard() )
    ON KEY CONTROL+H OF Form_Ajedrez ACTION ( Test_Syzygy_Directo() )
    ON KEY CONTROL+J OF Form_Ajedrez ACTION ( DownloadMissingSyzygy() )
Chess5.zip
(1.87 MiB) Downloaded 24 times
User avatar
gfilatov
Posts: 1120
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Harbour Chess

Post by gfilatov »

Steed wrote: ↑Fri Sep 18, 2026 1:45 am Coincidence of life: I’m working on a very similar project.(Minigui & HMG)
...
Thank you very much for your feedback!

Your project is very interesting 8-) , but there is a tiny problem :o with his interface language (Spanish/Portugal :?: ).

BTW You can see the 'About' dialog of the Harbour Chess app with the features description in the picture:
chess_about.png
chess_about.png (67.16 KiB) Viewed 120 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Steed
Posts: 462
Joined: Sat Dec 12, 2009 3:40 pm

Re: Harbour Chess

Post by Steed »

English versión
Chess5.zip
(1.87 MiB) Downloaded 12 times
User avatar
gfilatov
Posts: 1120
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Harbour Chess

Post by gfilatov »

Steed wrote: ↑Sat Sep 26, 2026 9:16 pm English versión
Thank you very much! This is much clearer now 8-)
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Post Reply