Hello Pascal lovers (and other)!
I think I never created a discussion to present my adaptation of the excellent Mater program by Valentin Albillo. It's a mate solver, originally written for Turbo Pascal. The new version can be compiled with Free Pascal for Linux and for Windows. You can find it here, with the original program:
https://gitlab.com/rchastain/mater
Yesterday I restarted to work on this project, after I discovered (thanks to this post) two positions for which Mater gives wrong results (unexisting mates). If someone is in the mood to break his head on this, I created an issue with all informations on the GitLab repository.
Regards.
Roland
Mater adapted for Free Pascal
Moderators: hgm, Rebel, chrisw
-
- Posts: 657
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Mater adapted for Free Pascal
Qui trop embrasse mal étreint.
-
- Posts: 231
- Joined: Thu Mar 09, 2006 12:51 am
- Location: Australia
Re: Mater adapted for Free Pascal
Thanks Roland! I hope you've been able to resolve the issue with those positions.
Andrew
Andrew
-
- Posts: 657
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Mater adapted for Free Pascal
Thank you Andrew for your support.
I found the error.
The "position 130" is correctly analyzed now.
Code: Select all
./mater -position "3r1n2/2bp2p1/1p1kp1Pp/4N2p/Pp2B2Q/7P/1P3P1B/K7 w - - 0 1" -moves 4
Mater 1.1.20211106
Position: 3r1n2/2bp2p1/1p1kp1Pp/4N2p/Pp2B2Q/7P/1P3P1B/K7 w - - 0 1
Moves number: 4
Search mode: all moves
Found mate in 4: e4a8
Time elapsed: 00:00:01:755
Qui trop embrasse mal étreint.
-
- Posts: 657
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Mater adapted for Free Pascal
Done. Also added a Makefile to the repository, so one can build Mater (and the demo program) easily for Linux or for Windows.
Since the bug in pawn move generation was fixed, the demo program finds a different solution for the position 4. It finds now g5g2, instead of f6d5. Not yet had time to check if it's a valid solution...
Qui trop embrasse mal étreint.
-
- Posts: 191
- Joined: Mon Oct 31, 2016 6:30 pm
- Location: England
Re: Mater adapted for Free Pascal
As a Pascal user, I wonder if you have ever managed to compile a version of the Booot chess engine to work in linux?Roland Chastain wrote: ↑Fri Nov 05, 2021 9:11 am Hello Pascal lovers (and other)!
I think I never created a discussion to present my adaptation of the excellent Mater program by Valentin Albillo. It's a mate solver, originally written for Turbo Pascal. The new version can be compiled with Free Pascal for Linux and for Windows. You can find it here, with the original program:
https://gitlab.com/rchastain/mater
Yesterday I restarted to work on this project, after I discovered (thanks to this post) two positions for which Mater gives wrong results (unexisting mates). If someone is in the mood to break his head on this, I created an issue with all informations on the GitLab repository.
Regards.
Roland
I used Borland Delphi many years ago and have since tried fpc and lazarus but have had no success compiling Booot. The Pascal source is supplied by the author but maybe its window's specific.
I have to use Booot with wine in linux but prefer to use native linux versions where possible.
-
- Posts: 657
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Mater adapted for Free Pascal
Unfortunately no. I tried, but gave up because there are many things to change, and there are things that I don't know how to replace.Colin-G wrote: ↑Sun Nov 07, 2021 1:12 pm As a Pascal user, I wonder if you have ever managed to compile a version of the Booot chess engine to work in linux?
I used Borland Delphi many years ago and have since tried fpc and lazarus but have had no success compiling Booot. The Pascal source is supplied by the author but maybe its window's specific.
Qui trop embrasse mal étreint.
-
- Posts: 657
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Mater adapted for Free Pascal
Stockfish MateFinder 9.7 finds also g5g2. So I have a doubt now on f6d5.Roland Chastain wrote: ↑Sun Nov 07, 2021 12:06 pm Since the bug in pawn move generation was fixed, the demo program finds a different solution for the position 4. It finds now g5g2, instead of f6d5. Not yet had time to check if it's a valid solution...
Would someone know a mate solver available for Linux, which detects multiple solutions?
Qui trop embrasse mal étreint.
-
- Posts: 854
- Joined: Thu Mar 09, 2006 4:50 pm
- Location: Austria
Re: Mater adapted for Free Pascal
Hi,
g5g2 is the only solution for this mate in 4:Roland Chastain wrote: ↑Sun Nov 07, 2021 9:44 pm Stockfish MateFinder 9.7 finds also g5g2. So I have a doubt now on f6d5.
Would someone know a mate solver available for Linux, which detects multiple solutions?
Code: Select all
ChestUCI Ver.5.2:
FEN: rnbK2R1/p6p/p1kNpN1r/P3B1Q1/3P1p1p/5p2/5p1b/8 w - - (8+14)
Position-Analysis: C0/R0/K1/P6/X13 W:7/36
Search for Special-Mate [C0/R0/K0/P0/X0] in 10 ... (Hash=256MB)
4 00:00 0 0 +M4 1.Qg2
Search completed ... (Time=0.03s)
Mate in 4 found ! (1 Solution in 00:00)
4/4 00:00 28.586 893.312 +M4 1.Qg2 fxg2 2.Rg3 hxg3 3.Ng8 f1Q 4.Ne7+
Best move: Qg2, Value: +Mate in 4, Depth: 4/4, Time: 00:00,104, 28.586 Nodes, 893.312 N/sec
Code: Select all
MaterUCI-Pro Ver.3.2:
Search for Mate in 1 ...
Search for Mate in 2 ...
Search for Mate in 3 ...
Search for Mate in 4 ...
4 00:00 4.860.056 4.860.056 +M4 1.Qg2 Bd7 2.Rf8 Bc8 3.Rf7 Nd7 4.Qxf3+
Best move: Qg2, Value: +Mate in 4, Depth: 4, Time: 00:00,838, 4.860.056 Nodes, 4.860.056 N/sec
-
- Posts: 657
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Mater adapted for Free Pascal
Hi! Thank you very much. Files updated.
Qui trop embrasse mal étreint.
-
- Posts: 945
- Joined: Fri Mar 10, 2006 4:29 pm
- Location: Germany
- Full name: Jörg Oster
Re: Mater adapted for Free Pascal
You might give Matefish 1.0 a try.Roland Chastain wrote: ↑Sun Nov 07, 2021 9:44 pmStockfish MateFinder 9.7 finds also g5g2. So I have a doubt now on f6d5.Roland Chastain wrote: ↑Sun Nov 07, 2021 12:06 pm Since the bug in pawn move generation was fixed, the demo program finds a different solution for the position 4. It finds now g5g2, instead of f6d5. Not yet had time to check if it's a valid solution...
Would someone know a mate solver available for Linux, which detects multiple solutions?
It is based on Stockfish 11 and at a very early stage.
It doesn't search for multiple/all solutions for now.
But as a workaround, it supports the searchmoves option just like Stockfish does.
Code: Select all
position fen rnbK2R1/p6p/p1kNpN1r/P3B1Q1/3P1p1p/5p2/5p1b/8 w - -
go mate 4
info string No mate in 1 found
info string No mate in 2 found
info string No mate in 3 found
info string Success! Mate in 4 found!
info depth 5 seldepth 7 multipv 1 score mate 4 nodes 126599 nps 1130348 tbhits 0 time 112 pv g5g2 f3g2 g8g3 h4g3 f6g8 f2f1q g8e7
bestmove g5g2 ponder f3g2
go mate 4 searchmoves f6d5
info string No mate in 1 found
info string No mate in 2 found
info string No mate in 3 found
info string No mate in 4 found
info depth 7 seldepth 7 multipv 1 score cp 0 nodes 1284 nps 428000 tbhits 0 time 3 pv f6d5
bestmove f6d5
You can find its source here https://github.com/joergoster/Stockfish/tree/matefish.
Compiling with gcc should be trivial, for example make build ARCH=x86-64-modern -j.
Jörg Oster