2009-09-28 43 views
6

是否有任何库可用于验证国际象棋移动和模拟.NET游戏?如果图书馆能够理解代数符号中的移动并为移动提供简单的API,那将会很棒。例如,game.Move(“E2”,“E4”)等。在第二种情况下,库应该能够为移动生成代数符号。 我不想让它做出动作或下棋等,只是一个游戏验证和游戏模拟的图书馆。 任何链接?国际象棋移动验证库

回答

2

还有sharpchess它是开放源码(下GNU GPL)和用于净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);