国际象棋步法验证库

6

有没有任何库可以用于验证.NET中的国际象棋移动并模拟游戏? 如果该库能够理解代数符号表示法中的移动并提供简单的API进行移动,那就太好了。例如,game.Move("E2","E4")等。在第二种情况下,该库应该能够为移动生成代数符号。我不希望它移动或玩国际象棋等等,只需要一个用于游戏验证和游戏模拟的库。有没有相关链接?

3个回答

4

2

还有一个名为sharpchess的开源项目(在GNU GPL下发布),并且是为.Net v2编写的。它具有核心引擎和WinForm GUI。虽然它可以下棋,但我认为你可能可以剥离“游戏引擎”以留下用于模拟的外壳。

以下是该网站提供的一些要点:

* Graphical chess board.
* Helpful high-lighting of legal chess moves, when clicking on a piece.
* Move history displayed.
* Undo/Redo moves.
* Load/Save chess games during play.
* Replay your saved games.
* Paste FEN positions from the clipboard.

国际象棋引擎特点

* WinBoard compatible.
* 0x88 board representation.
* Opening book containing over 1300 varied opening positions.

编程特性

* A well-designed, and hopefully easy-to-understand, object-model that will enable other developers to quickly get involved in the project.

1
我在github上发布了我的棋子移动验证器
示例:
var board = Board.GetNewBoard();

board.SetPiece<Rook>( ChessColor.White, 'A', 1 );

var result = board.MovePiece( 'A', 1, 'A', 8 );

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接