Package nl.zoidberg.calculon.engine

Examples of nl.zoidberg.calculon.engine.BitBoard


public class FENUtilsTest {

    @Test
  public void testFenConversion1() {
    String fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
    BitBoard board = new BitBoard().initialise();
    assertEquals(fen, FENUtils.generate(board));
    assertEquals(fen, FENUtils.generate(FENUtils.loadPosition(fen, board)));
  }
View Full Code Here


  }

    @Test
  public void testFenConversion2() {
    String fen = "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1";
    BitBoard board = new BitBoard();
    assertEquals(fen, FENUtils.generate(FENUtils.loadPosition(fen, board)));
  }
View Full Code Here

  }
   
    @Test
  public void testFenConversion3() {
    String fen = "rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2";
    BitBoard board = new BitBoard();
    assertEquals(fen, FENUtils.generate(FENUtils.loadPosition(fen, board)));
  }
View Full Code Here

  }
 
    @Test
  public void testFenConversion4() {
    String fen = "rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 0 2";
    BitBoard board = new BitBoard();
    assertEquals(fen, FENUtils.generate(FENUtils.loadPosition(fen, board)));
  }
View Full Code Here

  }

    @Test
  public void testFenConversion5() {
    String fen = "4k3/8/8/8/8/8/4P3/4K3 w - - 0 39";
    BitBoard board = new BitBoard();
    assertEquals(fen, FENUtils.generate(FENUtils.loadPosition(fen, board)));
   
    PGNUtils.applyMove(board, "Kd1");
    assertEquals("4k3/8/8/8/8/8/4P3/3K4 b - - 1 39", FENUtils.generate(board));
   
View Full Code Here

public class NotationTest {

    @Test
  public void testPgnMoves() {
    BitBoard board = new BitBoard().initialise();
   
    PGNUtils.applyMoves(board, new String[] { "e4", "c5", "Nf3", });
    assertEquals("rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2", FENUtils.generate(board));
  }
View Full Code Here

    assertEquals("rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2", FENUtils.generate(board));
  }
 
    @Test
  public void testChecks() {
    BitBoard board = FENUtils.getBoard("7k/R7/1R6/8/8/8/8/7K w - - 0 1");
    assertEquals("Rb8#", PGNUtils.translateMove(board, "B6B8"));

    board = FENUtils.getBoard("7k/R7/1R5n/8/8/8/8/7K w - - 0 1");
    assertEquals("Rb8+", PGNUtils.translateMove(board, "B6B8"));
  }
View Full Code Here

        "h4", "d5", "c3", "Nf6", "Qa4+", "Qd7", "Qf4", "g6", "b3", "b6", "Rh3", "Kd8", "d3", "h6", "Rf3", "a5",
        "Qa4", "Qxa4", "bxa4", "h5", "Rf4", "Bd7", "Na3", "Kc8", "Rd4", "e6", "Rf4", "Be7", "Nf3", "Bd8", "Ng1",
        "Bc6", "Rd4", "e5", "Rf4", "exf4", "c4", "dxc4", "dxc4", "Bxa4", "c5", "bxc5", "Bd2", "Bd7", "Bxf4",
        "Re8", "Bd2", "Be6", "Rc1", "a4", "Bf4", "Rh8", "Be3", "Re8", "Rc2", "Bf5", "Rd2",
    };
    BitBoard bb = new BitBoard().initialise();
   
    PGNUtils.applyMoves(bb, moves);
    assertTrue(PGNUtils.toPgnMoveMap(bb).containsKey("Nfd7"));
    assertTrue(PGNUtils.toPgnMoveMap(bb).containsKey("Nbd7"));
    PGNUtils.applyMove(bb, "Nfd7");
View Full Code Here

public class OpeningBookTest {
 
    @Test
  public void testOpeningBook() {
    OpeningBook.setUseOpeningBook(true);
    BitBoard board = FENUtils.getBoard("rnbqkbnr/ppp1pppp/8/3p4/8/1P6/P1PPPPPP/RNBQKBNR w KQkq d6 0 1");
    assertEquals("Bb2", OpeningBook.getDefaultBook().getBookMove(board));
  }
View Full Code Here

public class BoardTest {

    @Test
  public void threeRepeatDrawDetect1() {
    BitBoard bitBoard = new BitBoard().initialise();
   
    PGNUtils.applyMoves(bitBoard, new String[] { "Nf3", "Nf6", "Ng1", "Ng8", "Nf3", "Nf6", "Ng1", });
    assertEquals(22, new MoveGenerator(bitBoard).getAllRemainingMoves().size());
   
    PGNUtils.applyMove(bitBoard, "Ng8");
View Full Code Here

TOP

Related Classes of nl.zoidberg.calculon.engine.BitBoard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.