لینک کوتاه : https://en.magicfile.ir/?p=2502
هوش مصنوعی شطرنج تست محور با سی شارپ
مقدمه
This is a fully functional yet simple chess program that aims to help you understand how a chess engine works. There are already open source chess engines on the Internet that focus on high performance. This is a standard C# object oriented solution that is easier to understand. The focus has not been on building a fast, high-scoring chess engine. I've created a chess AI that makes nice moves with some code that we hope you'll enjoy reading. A number of more specific goals have been to properly implement Alpha Beta Pruning and Zobrist Hashing using C#.
زمینه
About ten years ago I tried to implement a chess engine and failed. This time, I decided to use the first method of Test Driven Development (TDD). I like TDD and I think using TDD was the main reason the engine worked this time. It is very important that the chess rules are executed 100% correctly. Equally important is that the undo moves lead back exactly to the previous state. I also think that TDD contributes to good code structure and maintainable system design.
کد
The solution consists of two main projects. Engine (chess.dll) and user interface. Chess.dll contains everything about the game, board, rules and engine. It also includes all tests. I saw no reason in this implementation to have unit tests in a separate project. In this way, it is easy to understand which test units belong to which class.
There are currently 82 tests. Most of them are very fast and the code coverage is around 100%. The total number of lines of code, including tests and user interface, is less than 4000. The game engine and class, which is mostly logic, is less than 900 lines of code.
همچنین پروژه کوچکی به نام BitChess در دست ساخت است.
Chess UI is a Windows Forms application that has only a few features such as loading, saving and timing for computer thinking. You can also edit and set custom board positions and save and load FEN positions.
برای شما کاربر عزیز پیشنهاد دانلود داده می شود