Mater for Free Pascal has a new home page.
I polished a bit the whole project (without essential modification) and made binaries for Linux and Windows.
Mater adapted for Free Pascal
Moderator: Ras
-
- Posts: 673
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: Mater adapted for Free Pascal
Qui trop embrasse mal étreint.
-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
Re: Mater adapted for Free Pascal
Hello.
My algorithm for solving chess problems.

My algorithm for solving chess problems.

-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
Re: Mater adapted for Free Pascal
You can find its source here https://codeberg.org/Alexlaw1964/chess_programming.git
-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
Re: Mater adapted for Free Pascal
With the transposition table, the number of nodes viewed will be significantly reduced.
I don't use transposition tables.
[d]8/1p6/7B/4p3/4k1P1/5n2/1P3PB1/K2R4 w - - 0 1 mate 4 moves
In this position, after the moves:
1. h6-c1 b7-b5
2. b2-b3 ...
or
1. b2-b3 b7-b5
2. h6-c1 ...
we get
[d]8/8/8/4p3/1p2k1P1/1P3n2/5PB1/K1BR4 w - -
In chess problems, the first move is important.
how to use transposition tables to reduce the nodes viewed and prune the search tree earlier?
how to apply the transposition table in solving chess problems?
I don't use transposition tables.
[d]8/1p6/7B/4p3/4k1P1/5n2/1P3PB1/K2R4 w - - 0 1 mate 4 moves
In this position, after the moves:
1. h6-c1 b7-b5
2. b2-b3 ...
or
1. b2-b3 b7-b5
2. h6-c1 ...
we get
[d]8/8/8/4p3/1p2k1P1/1P3n2/5PB1/K1BR4 w - -
In chess problems, the first move is important.
how to use transposition tables to reduce the nodes viewed and prune the search tree earlier?
how to apply the transposition table in solving chess problems?
-
- Posts: 960
- Joined: Fri Mar 10, 2006 4:29 pm
- Location: Germany
- Full name: Jörg Oster
Re: Mater adapted for Free Pascal
Good question!Alexlaw1964 wrote: ↑Thu Feb 06, 2025 1:23 pm With the transposition table, the number of nodes viewed will be significantly reduced.
I don't use transposition tables.
[d]8/1p6/7B/4p3/4k1P1/5n2/1P3PB1/K2R4 w - - 0 1 mate 4 moves
In this position, after the moves:
1. h6-c1 b7-b5
2. b2-b3 ...
or
1. b2-b3 b7-b5
2. h6-c1 ...
we get
[d]8/8/8/4p3/1p2k1P1/1P3n2/5PB1/K1BR4 w - -
In chess problems, the first move is important.
how to use transposition tables to reduce the nodes viewed and prune the search tree earlier?
how to apply the transposition table in solving chess problems?
My guess is you want to save a position where you achieve a cutoff into the TT.
If you then reach the same position and the stored depth of the entry is greater or equal to the current depth,
you can simply return.
Jörg Oster
-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
Re: Mater adapted for Free Pascal
I'll correct my question.Joerg Oster wrote: ↑Thu Feb 06, 2025 9:05 pm Good question!
My guess is you want to save a position where you achieve a cutoff into the TT.
If you then reach the same position and the stored depth of the entry is greater or equal to the current depth,
you can simply return.
When searching for a checkmate in 4 moves in a position
[d]8/1p6/7B/4p3/4k1P1/5n2/1P3PB1/K2R4 w - - 0 1
The algorithm must iterate through all 29 moves.
29.move:a1-a2
28.move:a1-b1
27.move:h6-f8
26.move:h6-g7
25.move:h6-g5
24.move:h6-f4
23.move:h6-e3
22.move:h6-d2
21.move:h6-c1
20.move:g2-f3
19.move:g2-h3
18.move:g2-f1
17.move:g2-h1
16.move:d1-d8
15.move:d1-d7
14.move:d1-d6
13.move:d1-d5
12.move:d1-d4
11.move:d1-d3
10.move:d1-d2
9.move:d1-b1
8.move:d1-c1
7.move:d1-e1
6.move:d1-f1
5.move:d1-g1
4.move:d1-h1
3.move:g4-g5
2.move:b2-b3
1.move:b2-b4
nodes=29
The algorithm will find a solution
1. Bc1 b5
2. b3 b4
3. Rd2 Kf4
4. Rd4#
After two half moves, a position will appear
[d] 8/8/8/4p3/1p2k1P1/1P3n2/5PB1/K1BR4 w - -
A score of 1 will be entered in the transposition table. (checkmate)
The algorithm will continue to work, iterating over the other initial moves.
After getting the same position, with a different sequence of moves.
1. b3 b5
2. Bc1 b4
In the transposition table, this position was rated as 1 (checkmate).
The program will choose a move 1.b3 , as a side decision.
And this one would be wrong!
Forgive me if I'm not making my thoughts clear.
-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
Re: Mater adapted for Free Pascal
After experimenting a bit,Joerg Oster wrote: ↑Thu Feb 06, 2025 9:05 pm If you then reach the same position and the stored depth of the entry is greater or equal to the current depth,
you can simply return.
I settled on the condition that if the stored depth is equal to the current depth and the same position is reached,
then we take the estimate from the hash.

-
- Posts: 16
- Joined: Fri Jan 03, 2025 6:36 am
- Full name: alex lobov
Re: Mater adapted for Free Pascal

With a transposition table, fewer nodes are viewed.
How to apply the transposition table correctly to the perft test?