I don't know if this is the right place to ask this kind of questions. I have programmed a chess aiAI in pythonPython. It uses the alpha-beta algorithm with move ordering. I want it to be able to look further than depth 4, without increasing calculation time. I am wondering, how I possibly could improve the efficiency of my code. I have a feeling that my code does a lot of unnecessary calculations.
Here is a Descriptiondescription on how my program works:
How to use it:
When you start it up, the board will be printed out and the human starts playing with the white pieces.
The human player has to enter the coordinates of the piece to move and after that, the coordinates where he wants to move the selected piece too
(Unlike in the AI-functions I have currently not implemented a function, which would only allow legal moves by the human.) After that, the updated board is printed.
Then, it's the AI's turn. It tries to find the best move with alpha-beta pruning (with move ordering). The evaluation function takes into consideration:
the position of the pieces (with the help of hash tables) and material balance. When it finishes calculating, it performs the move and prints the updated board.
Under the board, it spits out its predicted score and under that the number of chess boards it searched through:
The goal with this project is, to make an AI which outperforms decent chess players.
I would like it to reach an ELO somewhere around 1600. But in order to do that, I my number 1 priority is to improve the search depth.
The problem with this is, that it already takes an age to search at depth 4. I wonder if anyone could help me and point at some improvements I could make.
My programming skills are quite basic and I probably should comment my code better.
Thanks a lotThe goal with this project is to make an AI which outperforms decent chess players.
I would like it to reach an ELO somewhere around 1600,
John but in order to do that, my number 1 priority is to improve the search depth.
The problem with this is that it already takes an age to search at depth 4. I wonder if anyone could help me and point at some improvements I could make.
My programming skills are quite basic and I probably should comment my code better.