159 questions
1
vote
0
answers
67
views
xml in chess pgn using python
<line fen="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1">
<move m="e4"/>
<move m="e5"/>
<move m="d4"/>
<...
0
votes
1
answer
66
views
Why the python chess engine time goes downward Although the engine is running constantly without stopping?
When i tried this code in my main project to get infinite analysis in my chess GUI (I wanted the engine to think infinitely about a position and give its data (score, best move, etc..) and no depth or ...
1
vote
1
answer
241
views
Python chess engine is too slow
I have a working 1600 blitz level bot but it works too slow in python using python chess library. I tried to optimize the functions in eval function but the best it can do is depth 4 since it takes a ...
1
vote
1
answer
214
views
strange mistake when using Python chess library, after set.fen() and push(move), board.legel_moves generates wrong moves
I am writing a small chess GUI with Python chess library. Yesterday, I ran my code a lot of times without any problem. Then I installed some other Python libraries. Today I noticed a strange mistake: ...
-1
votes
1
answer
243
views
parsing moves from pgn
i have a service, that gets a game from database and adding moves to it. also, it edits current pgn (string of moves).Is there any functions, that can get given string of moves and parse moves from it?...
-1
votes
1
answer
51
views
while reading a value by using a for loop it gives me this error (ValueError: invalid literal for int() with base 10: '')
I am trying to make a chess game that can be ran on terminal and a variable that should have a value doesn't have a value and i don't know what is that cousing the problem
I want to make a chess ...
0
votes
0
answers
118
views
New figures on the Chess-Python-Board
I want to add to my Python Chess Endgame Engine 3 new figures:Amazon, Bob and Cyryl.Amazon moves like knight and bishop,Bob as a rook and knight
and Cyryl as Queen and Knight. I have code like this.
...
0
votes
1
answer
57
views
Python Chess Engine: How do I replace the piece thats on the inputted square with a "#"?
When the user inputs a coordinate like "a1", I want to find the piece that is on that square and replace its icon with a "#" character and render the new board. So the rook in the ...
2
votes
0
answers
106
views
chess endgame engine is not working completely correctly
I have proceeded a bit with my goal to obtain a chess-game endgame engine where both players would play fully optimally while there are D<5 pieces on the board so that I can wait for the result.The ...
0
votes
1
answer
187
views
How can I speed up my training time for a python-chess bot using ppo?
I am attempting to build a chess bot which learns using Proximal Policy Optimization. I am currently using the python-chess library (https://python-chess.readthedocs.io/en/latest/index.html#) as the ...
0
votes
0
answers
170
views
Why augmented_corners is not defined
I have forked code from GitHub that provided about Play online chess with real chess board.
But I found the error below:
Traceback (most recent call last):
File "board_calibration.py", ...
1
vote
0
answers
50
views
The Reti endgame
I'm trying to make my code in Python to solve correctly the Reti endgame by pushing Kh8 to Kg7, which is the only move leading to a draw for white. However the code given below keeps saying
Positions ...
0
votes
1
answer
153
views
Chess endgame engine built on my own with BFS algorithm and dictionary data structure
I was using ChatGPT4 for creating a chess code for the problem stated below,
but mostly I was not obtaining any results beyond "depth 0 up to depth 19" with the number of positions searched....
0
votes
0
answers
245
views
python-chess stockfish analysis died unexpectedly
I'm trying to get position evaluation using Stockfish on python-chess. From a total of 1 million FEN position, Stockfish will return the score. However, after the 25430th position (oddly specific), ...
0
votes
0
answers
129
views
How to print second best move in python-chess, along with first bes move
I'm currently trying to create a program using Python-Chess that will analyse games for me, and give a list of best, and second best moves. Even though lichess.org and chess.com have good UI for this, ...
1
vote
0
answers
71
views
Script for Chess GUI not loading the right images when execute?
I have this simple code using Python that will allow me to play chess against Stockfish. I also implemented a simple GUI that helps visualize the pieces easier. I have name the black pieces images &...
1
vote
1
answer
135
views
Best Way to Debug html5lib.html5parser.ParseError: Unexpected character after attribute value"?
I am currently working on a personal project and utilizing the chessdotcom Public API Package. I am currently able to store in a variable the PGN from the daily puzzle (Portable Game Notation) which ...
0
votes
3
answers
646
views
Can't make Python Stockfish weaker
I’ve written a chess software in Python which use Stockfish via this library:
https://pypi.org/project/stockfish/
The software works and plays well. Too well actually…
Mi idea was the app can offer a ...
-1
votes
1
answer
154
views
How to use Python multiprocessing library in a chess search algorithm?
I am currently working on a chess engine, and I am looking at parallelization as a way to optimize the time it takes to search legal moves to find the best one. I found the Python module ...
1
vote
0
answers
149
views
Unable to make a python-chess engine communicating with Arena GUI
I've been trying to make a custom python engine, that uses UCI protocol to communicate it's moves. I'm able to understand how the UCI protocol works, but I don't understand how to make my python ...
1
vote
0
answers
142
views
genrating sliding piece moves on bitboard efficiently without magic bitboard
I'm currently working to improve a chess engine in python. more specifically I'm working on the move generation of sliding pieces, like rooks and bishops. originally I used this loop function for both ...
1
vote
0
answers
45
views
can negamax be implemented for 4 player chess?(bughouse)
I am seeing that negamax is often used for chess engines.However there is only popular instances of it being used in the conventional game.Is negamax good for the variants of chess like bughouse or is ...
1
vote
1
answer
441
views
Extracting data from PGN files
I trying to extract move information and annotations from a few PGN files, outputting to a text file. My current code is:
import chess.pgn
import io
import os
def handle_san_error(pgn_file, game_str, ...
1
vote
1
answer
153
views
Python chess search function: pop from empty list
This is my search function for python chess engine:
def search(pos: position.Position, depth: int, alpha: int, beta: int, side_to_move: chess.Color, root: bool = False):
global nodes, best_score, ...
0
votes
1
answer
105
views
Failure to properly load a chess board in Pygame
I am attempting to create a chess GUI. I was able to make it so that when the player is White, everything loads perfectly. However, when I try to load when the player is Black, it does not load ...