Hot answers tagged

13

This exact bot has already been created. On lichess, it is simpleEval. You could potentially use it to debug a lot of your issues by seeing what this engine does against you in a given position. Having played this bot several times, no that move Nxf2 would probably be incorrect. This seems like a bug on your end. Assuming you have enough depth in the bot's ...


7

It's always a question at what depth you stop. Eg.g, with 5 plys, your engine might be happy with ... Nxf2 one pawn ahead Bxf2 Bxf2 still one pawn ahead Kxf2 Qxf3+ still one pawn ahead and even check! and not see 4. Kxf3. Something like this chould be prevented e.g. by selectively expanding until no capture / no check is made. Even then, the evaluation ...


5

You are confusing several concepts. Alpha-beta pruning Alpha-beta pruning is not "where they don't calculate positions that are obviously winning or obviously losing." It's pruning branches where it doesn't matter what their evaluation is, because another move is already good enough to know that this direction won't work. For instance, the opening ...


4

I have not tried it, but you might be able to install Chess Position Trainer under Linux using WINE. I haven't looked at WINE in a long time, but it's apparently a lot better than it was ~10 years ago when I last tried to do anything with it.


4

Sorry, no. Chess Position Trainer only runs on Windows 7, 8, and 10. See the system requirements here. You could consider a virtual machine running Windows on a Linux host, but it will not run natively.


3

Build a cache. You're exposing yourself to endless transposition. Please don't shuffle your moves. I don't have the numbers but I doubt randomly shuffle all your lists can be quick. It's O(n). I fail to see how it can address your repetition anyway. Double check your generator. Source code is not here, so I have no idea I don't know what exactly your table ...


3

If a chess engine isn't aware of the mate, then it will be happy to play the moves as Black. By the time it sees the checkmate, it'd be too late. Game over. 1-0. Fortunately, your scenario is quite simple. A good engine should have sufficient depth to see the mate. The iterative deepening depth-first algorithm will allow searches with increasing depth limits:...


3

Your approach is correct. Stockfish does it as well. https://github.com/official-stockfish/Stockfish/blob/master/src/search.cpp if (rootMoves.empty()) { rootMoves.emplace_back(MOVE_NONE); sync_cout << "info depth 0 score " << UCI::value(rootPos.checkers() ? -VALUE_MATE : VALUE_DRAW) << sync_endl; } There ...


3

In alpha/beta pruning, you only prune when further search cannot affect the outcome. In particular this means there will be no loss of information when you transition from MinMax to alpha/beta. There is only upside to alpha/beta (in contrast to other, more aggressive pruning methods). The fundamental idea of alpha/beta pruning is that once you discover a ...


3

There are two simple adjustments that need to be made for this to work properly with the computer playing the white pieces. I'm not totally familiar with the interfaces you're using so bear with me. while not board.is_game_over(): if board.turn == True: This if statement is used to determine at which point the computer starts evaluating moves and at ...


2

There're some problems with your question: Alpha-beta pruning doesn't make you search faster, it makes you search further. For illustration (these numbers are not accurate) if your computer is searching at 1 million nodes (here a "node" is a position) per second, without alpha-beta pruning you might only make it 5 ply deep. With it, you might reach 10 ply. ...


2

I need to get two things out of the way: If your are concerned about performance, Python is not for you. The language just isn't built for this kind of thing. That said, I do think it can be useful for learning/building your first engine, but it's unlikely your engine will be very strong. Speed improvements for an engine come from optimizations to the ...


1

This lack of opening diversity problem affects even the strongest engines, so don't worry about it. Still, there are things you can do: Add some small random factor to your eval, such that most positions do not return exactly the same number. Many of the strongest engines already do this, not because they want to play different openings, but because it ...


1

There are oodles of programs for linux. Take your choice. Stockfish runs on linux. And many other places too. It is open source so you can modify the code to do what you want. These are rated 'best' chess aps for Linux: PyChess Advanced chess client following the GNOME Human Interface Guidelines ///// Cute Chess Graphical user interface, command-...


1

No. You have to go to the end of that branch to decide if it is bad. pruning is done to help make the problem computationally feasible. But there are risks that you might have eliminated a better branch. That depends how far out you look and how good your algorithm is to assess the position before you trim it. Cutting anything after only a few moves ...


1

Not an answer but an example of the question: [FEN ""] [Event "?"] [Site "Bled"] [Date "1961"] [Round "?"] [White "T. Petrosian"] [black "L. Pachman"] [startply "40"] 1. Nf3 c5 2. g3 Nc6 3. Bg2 g6 4. O-O Bg7 5. d3 e6 6. e4 Nge7 7. Re1 O-O 8. e5 d6 9. exd6 Qxd6 10. Nbd2 Qc7 11. Nb3 Nd4 12. Bf4 Qb6 13. Ne5 Nxb3 14. Nc4! Qb5 15. axb3 a5 16. Bd6! Bf6 17. Qf3! ...


1

Yes, you'll have to search all moves in minimax as it's a framework for determining the evaluation score. In alpha-beta, you might skip some moves by pruning.


1

Let's say you wanted your engine to calculate 10 moves ahead. To do this, you must look at each different combination of 10 moves from the current position, and evaluate each of the final positions that you get from doing this. Then, you apply minimax by working backwards and assigning evaluations to the previous positions up the tree. You are correct in ...


1

Short answer: Yes with minimax you have to search every move. Minimax is not used due to the exponentially growing search which quickly becomes too big to be useful. Think O(n2) sort functions. Many concepts are used to help reduce the number of nodes the search function. Transposition Tables, fail-safe, branch pruning... https://web.archive.org/web/...


Only top voted, non community-wiki answers of a minimum length are eligible