use of com.playshogi.library.shogi.models.position.ShogiPosition in project playshogi by Tellmarch.
the class KifFormatTest method readOnlyPositionDokoro.
@Test
public void readOnlyPositionDokoro() {
ShogiPosition pos = KifFormat.INSTANCE.readPosition(KIF_ONLY_POSITION_DOKORO);
assertEquals("lnsgkgsnl/1r5+B1/pppppp1pp/6p2/9/2P6/PP1PPPPPP/7R1/LNSGKGSNL w B", SfenConverter.toSFEN(pos));
}
use of com.playshogi.library.shogi.models.position.ShogiPosition in project playshogi by Tellmarch.
the class SfenConverterTest method testFromSFENAndToSFENWithMoveCount.
@Test
public void testFromSFENAndToSFENWithMoveCount() {
ShogiPosition position = SfenConverter.fromSFEN(sfen);
assertEquals(sfenWithMoveCount, SfenConverter.toSFENWithMoveCount(position));
}
use of com.playshogi.library.shogi.models.position.ShogiPosition in project playshogi by Tellmarch.
the class SfenConverterTest method testFromSFENAndToSFEN.
@Test
public void testFromSFENAndToSFEN() {
ShogiPosition position = SfenConverter.fromSFEN(sfen);
assertEquals(sfen, SfenConverter.toSFEN(position));
}
use of com.playshogi.library.shogi.models.position.ShogiPosition in project playshogi by Tellmarch.
the class ShogiRulesEngineTest method getAllPossibleDropMovesForSente.
@Test
public void getAllPossibleDropMovesForSente() {
String sfen = "lnsg3nl/2k2gr2/ppbp1p1pp/2p1P4/4s1S2/5B3/PPPP1P1PP/2S1GGR2/LN4KNL b 2Pp";
ShogiPosition position = SfenConverter.fromSFEN(sfen);
List<ShogiMove> allPossibleDropMoves = engine.getAllPossibleDropMoves(position, Player.BLACK);
assertEquals(4, allPossibleDropMoves.size());
}
use of com.playshogi.library.shogi.models.position.ShogiPosition in project playshogi by Tellmarch.
the class BishopMovementTest method setUp.
@Before
public void setUp() {
position = new ShogiPosition();
bishopMovement = new BishopMovement();
for (int r = 1; r <= 4; r++) expected[4 - r][4 - r] = expected[4 - r][4 + r] = expected[4 + r][4 - r] = expected[4 + r][4 + r] = true;
}
Aggregations