I have an idea:yurikvelo wrote:What is highest number of legal moves in a position, ever observed?
In perft<14, not in puzzles
https://www.chess.com/forum/view/fun-wi ... ible-moves
1.- Download huge PGN files like CCRL 40/4. There are others like CEGT, Frank's Amateur Schach...
2.- Use Norm's PGN utility 'truncate':
Code: Select all
=========================(50) truncate =============================
"truncate" removes all plies (half-moves) in each game that occur
after a user-specified "maximum_plies".
Results are not removed.
"truncate" removes existing "PlyCount" tags.
"truncate" removes comments, nags, variations and major symbolic
annotation symbols (!, !!, ?, ??, !?, ?!, +-, -+, +/-, -/+, +=,
=+, +/=, =/+, =, ~, and N).
Syntax: truncate filename.pgn maximum_plies
Example: truncate alpha.pgn 50
Output: outU.pgn
Comments:
1. To remove all game moves but leave the results:
truncate alpha.pgn 0
2. New "PlyCount" tags can be inserted using the program
"plyCount".
====================================================================I would use truncate file.pgn 13 since you want perft < 14. Make sure that the uncompressed PGN is in the same folder than the PGN utility.
3.- Run the tool Joined from the command prompt. Make sure that the truncated PGN is in the same folder than joined.exe executable. Download link of Joined.
Example run:
Code: Select all
C:\[...]\joined>joined -h
Illegal option: h !
Usage: joined [<*.PGN, *.FEN or *.EPD file>] [-<options>]
Legal options are:
-p : Print messages to both stderr and stdout
-q : Quit after scanning input file
-r : Initial value for random algorithm
-s : Print messages only to stdout
-v<number>: Set verbose level to <number> (default 4)
The numbers may be added. The numbers are:
1: Print PGN
2: Calculate number of legal moves in all positions
4: Print progress (default)
8: Print all warnings
16: Check PGN
32: Report result = '*'
64: Get statistics on all types of moves
***** Error exit *****
C:\[...]\joined>joined beta.pgn -q -v126
Scanning file beta.pgn containing 10637 bytes !
Read 12 games with 1384 moves, 264 lines, 10637 bytes !
Got max. 187 moves in game 4 before line 92 !
Got 37861 legal moves in 1396 positons !
Got max. 52 legal moves after move 34 in game 3 line 60 !
Total move statistics:
Pawn moves = 323, Knight moves = 251, Bishop moves = 148
Rook moves = 344, Queen moves = 104, King moves = 232
Check moves = 118, Mate moves = 0, Stalemate moves = 0
Hit moves = 268, En passant moves = 0, Pawn two moves = 76
Short castlings = 17, Long castlings = 1
Promotion to queen = 1, Promotion to rook = 0
Promotion to bishop = 0, Promotion to knight = 0
Total game statistics:
White won = 5, Drawn = 6, Black won = 1
Unknown result = 0, Illegal result = 0, Conflicting results = 0
White mated = 0, White stalemated = 0
Black mated = 0, Black stalemated = 0
Number of games with different lengths:
87: 2, 93: 1, 95: 1, 99: 1, 101: 1, 107: 1
114: 1, 124: 1, 131: 1, 159: 1, 187: 1
C:\[...]\joined>Code: Select all
C:\[...]\joined>joined beta.pgn -q -v62
Scanning file beta.pgn containing 10637 bytes !
Read 12 games with 1384 moves, 264 lines, 10637 bytes !
Got max. 187 moves in game 4 before line 92 !
Got 37861 legal moves in 1396 positons !
Got max. 52 legal moves after move 34 in game 3 line 60 !
C:\[...]\joined>4.- (Optional): you can open the PGN with a text editor like Notepad++ and go to the line where Joined says that you can find the maximum number of legal moves. Since all games are short (13 plies or less), you can play through the game with a GUI and check the position with a perft counter.
------------------------
I do not know how Joined handles the case where the maximum number of legal moves in the PGN is shared between two or more positions: does it report the first, the last or all positions? I also have other doubt: when you read ... legal moves after move M in game G line L !, this move M may refer to ply. Just check it yourself.
I do not do it myself because I am currently getting astonishing download speeds of circa 25 KB/s, so the step 1 is horribly slow.
As a side note, the current record of legal moves is 218. Please search 218 in your browser in the following CPW page:
chessprogramming - Encoding Moves
Regards from Spain.
Ajedrecista.
