本文整理汇总了C#中ChessGame.GetFen方法的典型用法代码示例。如果您正苦于以下问题:C# ChessGame.GetFen方法的具体用法?C# ChessGame.GetFen怎么用?C# ChessGame.GetFen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChessGame
的用法示例。
在下文中一共展示了ChessGame.GetFen方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAfter1e4
public static void TestAfter1e4()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
string fen = game.GetFen();
Assert.AreEqual("rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1", fen);
}
示例2: TestAfter1c5
public static void TestAfter1c5()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
game.ApplyMove(new Move("C7", "C5", Player.Black), true);
string fen = game.GetFen();
Assert.AreEqual("rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2", fen);
}
示例3: TestMovingWhiteKingLosingCastlingRights
public static void TestMovingWhiteKingLosingCastlingRights()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
game.ApplyMove(new Move("C7", "C5", Player.Black), true);
game.ApplyMove(new Move("E1", "E2", Player.White), true);
string fen = game.GetFen();
Assert.AreEqual("rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPPKPPP/RNBQ1BNR b kq - 1 2", fen);
}
示例4: TestMovingBlackKingLosingCastlingRights
public static void TestMovingBlackKingLosingCastlingRights()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
game.ApplyMove(new Move("E7", "E5", Player.Black), true);
game.ApplyMove(new Move("G1", "F3", Player.White), true);
game.ApplyMove(new Move("E8", "E7", Player.Black), true);
string fen = game.GetFen();
Assert.AreEqual("rnbq1bnr/ppppkppp/8/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQ - 2 3", fen);
}
示例5: TestFenCastlingFieldAfterRookCapture_WhiteQueenside
public static void TestFenCastlingFieldAfterRookCapture_WhiteQueenside()
{
ChessGame game = new ChessGame("rnbqk1nr/ppppppbp/6p1/8/6P1/1P6/P1PPPP1P/RNBQKBNR b KQkq - 0 3");
game.ApplyMove(new Move("g7", "a1", Player.Black), true);
Assert.False(game.CanWhiteCastleQueenSide);
Assert.AreEqual("rnbqk1nr/pppppp1p/6p1/8/6P1/1P6/P1PPPP1P/bNBQKBNR w Kkq - 0 4", game.GetFen());
}
示例6: TestFenCastlingFieldAfterRookCapture_WhiteKingside
public static void TestFenCastlingFieldAfterRookCapture_WhiteKingside()
{
ChessGame game = new ChessGame("rn1qkbnr/pbpppppp/1p6/8/1P6/6P1/P1PPPP1P/RNBQKBNR b KQkq - 0 3");
game.ApplyMove(new Move("b7", "h1", Player.Black), true);
Assert.False(game.CanWhiteCastleKingSide);
Assert.AreEqual("rn1qkbnr/p1pppppp/1p6/8/1P6/6P1/P1PPPP1P/RNBQKBNb w Qkq - 0 4", game.GetFen());
}
示例7: TestFenCastlingFieldAfterRookCapture_BlackQueenside
public static void TestFenCastlingFieldAfterRookCapture_BlackQueenside()
{
ChessGame game = new ChessGame("rnbqkbnr/p1pppp1p/1p4p1/8/8/6P1/PPPPPPBP/RNBQK1NR w KQkq - 0 3");
game.ApplyMove(new Move("g2", "a8", Player.White), true);
Assert.False(game.CanBlackCastleQueenSide);
Assert.AreEqual("Bnbqkbnr/p1pppp1p/1p4p1/8/8/6P1/PPPPPP1P/RNBQK1NR b KQk - 0 3", game.GetFen());
}
示例8: TestFenCastlingFieldAfterRookCapture_BlackKingside
public static void TestFenCastlingFieldAfterRookCapture_BlackKingside()
{
ChessGame game = new ChessGame("rnbqkbnr/p1pppp1p/1p4p1/8/8/1P6/PBPPPPPP/RN1QKBNR w KQkq - 0 3");
game.ApplyMove(new Move("b2", "h8", Player.White), true);
Assert.False(game.CanBlackCastleKingSide);
Assert.AreEqual("rnbqkbnB/p1pppp1p/1p4p1/8/8/1P6/P1PPPPPP/RN1QKBNR b KQq - 0 3", game.GetFen());
}
示例9: TestMovingWhiteHRookLosingCastlingRights
public static void TestMovingWhiteHRookLosingCastlingRights()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("H2", "H3", Player.White), true);
game.ApplyMove(new Move("E7", "E5", Player.Black), true);
game.ApplyMove(new Move("H1", "H2", Player.White), true);
string fen = game.GetFen();
Assert.AreEqual("rnbqkbnr/pppp1ppp/8/4p3/8/7P/PPPPPPPR/RNBQKBN1 b Qkq - 1 2", fen);
}
示例10: TestMovingWhiteARookLosingCastlingRights
public static void TestMovingWhiteARookLosingCastlingRights()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("A2", "A3", Player.White), true);
game.ApplyMove(new Move("E7", "E5", Player.Black), true);
game.ApplyMove(new Move("A1", "A2", Player.White), true);
string fen = game.GetFen();
Assert.AreEqual("rnbqkbnr/pppp1ppp/8/4p3/8/P7/RPPPPPPP/1NBQKBNR b Kkq - 1 2", fen);
}
示例11: TestStartPosition
public static void TestStartPosition()
{
ChessGame game = new ChessGame();
string fen = game.GetFen();
Assert.AreEqual("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", fen);
}
示例12: TestHalfmoveClockAndFullmoveNumber
public static void TestHalfmoveClockAndFullmoveNumber()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
game.ApplyMove(new Move("E7", "E5", Player.Black), true);
game.ApplyMove(new Move("E1", "E2", Player.White), true);
game.ApplyMove(new Move("E8", "E7", Player.Black), true);
game.ApplyMove(new Move("E2", "D3", Player.White), true);
game.ApplyMove(new Move("E7", "D6", Player.Black), true);
game.ApplyMove(new Move("D3", "C3", Player.White), true);
game.ApplyMove(new Move("D6", "C6", Player.Black), true);
game.ApplyMove(new Move("C3", "B3", Player.White), true);
game.ApplyMove(new Move("C6", "B6", Player.Black), true);
game.ApplyMove(new Move("B3", "A4", Player.White), true);
game.ApplyMove(new Move("B6", "C5", Player.Black), true);
game.ApplyMove(new Move("F1", "C4", Player.White), true);
string fen = game.GetFen();
Assert.AreEqual("rnbq1bnr/pppp1ppp/8/2k1p3/K1B1P3/8/PPPP1PPP/RNBQ2NR b - - 11 7", fen);
game.ApplyMove(new Move("C5", "C4", Player.Black), true);
fen = game.GetFen();
Assert.AreEqual("rnbq1bnr/pppp1ppp/8/4p3/K1k1P3/8/PPPP1PPP/RNBQ2NR w - - 0 8", fen);
game.ApplyMove(new Move("A4", "A5", Player.White), true);
game.ApplyMove(new Move("H7", "H5", Player.Black), true);
fen = game.GetFen();
Assert.AreEqual("rnbq1bnr/pppp1pp1/8/K3p2p/2k1P3/8/PPPP1PPP/RNBQ2NR w - h6 0 9", fen);
}
示例13: TestMovingBlackHRookLosingCastlingRights
public static void TestMovingBlackHRookLosingCastlingRights()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
game.ApplyMove(new Move("H7", "H6", Player.Black), true);
game.ApplyMove(new Move("G1", "F3", Player.White), true);
game.ApplyMove(new Move("H8", "H7", Player.Black), true);
string fen = game.GetFen();
Assert.AreEqual("rnbqkbn1/pppppppr/7p/8/4P3/5N2/PPPP1PPP/RNBQKB1R w KQq - 2 3", fen);
}
示例14: TestMovingBlackARookLosingCastlingRights
public static void TestMovingBlackARookLosingCastlingRights()
{
ChessGame game = new ChessGame();
game.ApplyMove(new Move("E2", "E4", Player.White), true);
game.ApplyMove(new Move("A7", "A6", Player.Black), true);
game.ApplyMove(new Move("G1", "F3", Player.White), true);
game.ApplyMove(new Move("A8", "A7", Player.Black), true);
string fen = game.GetFen();
Assert.AreEqual("1nbqkbnr/rppppppp/p7/8/4P3/5N2/PPPP1PPP/RNBQKB1R w KQk - 2 3", fen);
}