Package com.tinygo.logic

Examples of com.tinygo.logic.DocumentedGame.kifuLastMove()


                                    if (mode == probMode) {
                                        // skip first "Pass" moves, since we don't have "Pass" in problem mode
                                        SGFNode lastSetupNode = game.kifuFirstMove(true).iterator().prev(false);
                                        if (lastSetupNode != null) {
                                            try {
                                                while (game.kifuLastMove() != lastSetupNode && game.next())
                                                    // DO NOTHING
                                                    ;
                                            } catch (GameException e) {
                                                // DO NOTHING
                                            }
View Full Code Here


                                    if (mode == probMode) {
                                        // skip first "Pass" moves, since we don't have "Pass" in problem mode
                                        SGFNode lastSetupNode = game.kifuFirstMove(true).iterator().prev(false);
                                        if (lastSetupNode != null) {
                                            try {
                                                while (game.kifuLastMove() != lastSetupNode && game.next())
                                                    // DO NOTHING
                                                    ;
                                            } catch (GameException e) {
                                                // DO NOTHING
                                            }
View Full Code Here

            SGFNode n2w, n3b_1, n3b_2;
            // test forward/backward navigation
            game.play(3, 3, Board.BLACK);
            game.play(0, 1, Board.WHITE);
            n2w = game.kifuLastMove();
            game.play(0, 2, Board.BLACK);
            n3b_1 = game.kifuLastMove();

            assertTrue(game.prev());
            assertSame(n2w, game.kifuLastMove());
View Full Code Here

            // test forward/backward navigation
            game.play(3, 3, Board.BLACK);
            game.play(0, 1, Board.WHITE);
            n2w = game.kifuLastMove();
            game.play(0, 2, Board.BLACK);
            n3b_1 = game.kifuLastMove();

            assertTrue(game.prev());
            assertSame(n2w, game.kifuLastMove());
            assertEquals(board.pos(0, 1), game.lastMove);
            assertEquals(Board.BLACK, game.colorToPlay);
View Full Code Here

            n2w = game.kifuLastMove();
            game.play(0, 2, Board.BLACK);
            n3b_1 = game.kifuLastMove();

            assertTrue(game.prev());
            assertSame(n2w, game.kifuLastMove());
            assertEquals(board.pos(0, 1), game.lastMove);
            assertEquals(Board.BLACK, game.colorToPlay);
            assertTrue(game.next());
            assertSame(n3b_1, game.kifuLastMove());
            assertEquals(board.pos(0, 2), game.lastMove);
View Full Code Here

            assertTrue(game.prev());
            assertSame(n2w, game.kifuLastMove());
            assertEquals(board.pos(0, 1), game.lastMove);
            assertEquals(Board.BLACK, game.colorToPlay);
            assertTrue(game.next());
            assertSame(n3b_1, game.kifuLastMove());
            assertEquals(board.pos(0, 2), game.lastMove);
            assertEquals(Board.WHITE, game.colorToPlay);
            assertFalse(game.next());

            // test variant navigation
View Full Code Here

            assertFalse(game.next());

            // test variant navigation
            assertTrue(game.prev());
            game.play(0, 0, Board.BLACK); // variant to 0,2
            n3b_2 = game.kifuLastMove();
            assertEquals(board.pos(0, 0), game.lastMove);
            assertFalse(game.nextVariant());
            assertTrue(game.prevVariant());
            assertSame(n3b_1, game.kifuLastMove());
            assertEquals(board.pos(0, 2), game.lastMove);
View Full Code Here

            game.play(0, 0, Board.BLACK); // variant to 0,2
            n3b_2 = game.kifuLastMove();
            assertEquals(board.pos(0, 0), game.lastMove);
            assertFalse(game.nextVariant());
            assertTrue(game.prevVariant());
            assertSame(n3b_1, game.kifuLastMove());
            assertEquals(board.pos(0, 2), game.lastMove);
            assertFalse(game.prevVariant());
            assertTrue(game.nextVariant());
            assertSame(n3b_2, game.kifuLastMove());
            assertEquals(board.pos(0, 0), game.lastMove);
View Full Code Here

            assertTrue(game.prevVariant());
            assertSame(n3b_1, game.kifuLastMove());
            assertEquals(board.pos(0, 2), game.lastMove);
            assertFalse(game.prevVariant());
            assertTrue(game.nextVariant());
            assertSame(n3b_2, game.kifuLastMove());
            assertEquals(board.pos(0, 0), game.lastMove);

            assertEquals(Board.WHITE, game.colorToPlay);

            // check if variant option is remembered
View Full Code Here

            assertEquals(Board.WHITE, game.colorToPlay);

            // check if variant option is remembered
            assertFalse(game.nextVariant());
            assertTrue(game.prev());
            assertSame(n2w, game.kifuLastMove());
            assertTrue(game.next());
            assertSame(n3b_2, game.kifuLastMove());
            assertFalse(game.nextVariant());
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.