Examples of BouzyMap


Examples of com.tinygo.logic.BouzyMap

                notify = true;
            }
            return notify;
        }
        boolean doScoreDone() {
            BouzyMap bmap = new BouzyMap(game.board);
            bmap.eval();
            Score score = game.getScore(bmap);

            statusScreen.displayScore(score);
//      Alert a = new Alert(LC._("Result"), score.scoreText, null, AlertType.INFO);
//      a.setTimeout(Alert.FOREVER);
View Full Code Here

Examples of com.tinygo.logic.BouzyMap

                notify = true;
            }
            return notify;
        }
        boolean doScoreDone() {
            BouzyMap bmap = new BouzyMap(game.board);
            bmap.eval();
            Score score = game.getScore(bmap);

            statusScreen.displayScore(score);
//      Alert a = new Alert(LC._("Result"), score.scoreText, null, AlertType.INFO);
//      a.setTimeout(Alert.FOREVER);
View Full Code Here

Examples of com.tinygo.logic.BouzyMap

                notify = true;
            }
            return notify;
        }
        boolean doScoreDone() {
            BouzyMap bmap = new BouzyMap(game.board);
            bmap.eval();
            Score score = game.getScore(bmap);

            statusScreen.displayScore(score);
//      Alert a = new Alert(LC._("Result"), score.scoreText, null, AlertType.INFO);
//      a.setTimeout(Alert.FOREVER);
View Full Code Here

Examples of com.tinygo.logic.BouzyMap

    public void testAll() {
        Board board1 = new Board(9);
        board1.set(3, 4, Board.BLACK);
        board1.set(5, 4, Board.BLACK);
        BouzyMap bmap1 = new BouzyMap(board1);

        Board board2 = new Board(9);
        board2.set(3, 4, Board.WHITE);
        board2.set(5, 4, Board.WHITE);
        BouzyMap bmap2 = new BouzyMap(board2);

        bmap1.eval(1, 0);
        bmap2.eval(1, 0);
        int[] d1 = {
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 1, 128, 2, 128, 1, 0, 0,
                0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0
        };
        for (int pos = 0; pos < d1.length; pos++) {
            assertEquals(d1[pos], bmap1.get(pos));
            assertEquals(-d1[pos], bmap2.get(pos));
        }

        bmap1.eval(1, 0);
        bmap2.eval(1, 0);
        int[] d2 = {
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 2, 2, 3, 2, 2, 0, 0,
                0, 1, 2, 132, 4, 132, 2, 1, 0,
                0, 0, 2, 2, 3, 2, 2, 0, 0,
                0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0
        };
        for (int pos = 0; pos < d2.length; pos++) {
            assertEquals(d2[pos], bmap1.get(pos));
            assertEquals(-d2[pos], bmap2.get(pos));
        }

        bmap1.eval(1, 0);
        bmap2.eval(1, 0);
        int[] d3 = {
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 2, 2, 3, 2, 2, 0, 0,
                0, 2, 4, 6, 6, 6, 4, 2, 0,
                1, 2, 6, 136, 8, 136, 6, 2, 1,
                0, 2, 4, 6, 6, 6, 4, 2, 0,
                0, 0, 2, 2, 3, 2, 2, 0, 0,
                0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0
        };
        for (int pos = 0; pos < d3.length; pos++) {
            assertEquals(d3[pos], bmap1.get(pos));
            assertEquals(-d3[pos], bmap2.get(pos));
        }

        bmap1.eval(0, 1);
        bmap2.eval(0, 1);
        int[] d4 = {
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 2, 2, 2, 0, 0, 0,
                0, 0, 4, 6, 6, 6, 4, 0, 0,
                0, 2, 6, 136, 8, 136, 6, 2, 0,
                0, 0, 4, 6, 6, 6, 4, 0, 0,
                0, 0, 0, 2, 2, 2, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0
        };
        for (int pos = 0; pos < d4.length; pos++) {
            assertEquals(d4[pos], bmap1.get(pos));
            assertEquals(-d4[pos], bmap2.get(pos));
        }

        bmap1.eval(0, 4);
        bmap2.eval(0, 4);
        int[] d5 = {
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 1, 4, 1, 0, 0, 0,
                0, 0, 0, 136, 8, 136, 0, 0, 0,
                0, 0, 0, 1, 4, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0
        };
        for (int pos = 0; pos < d5.length; pos++) {
            assertEquals(d5[pos], bmap1.get(pos));
            assertEquals(-d5[pos], bmap2.get(pos));
        }
    }
View Full Code Here

Examples of com.tinygo.logic.BouzyMap

                notify = true;
            }
            return notify;
        }
        boolean doScoreDone() {
            BouzyMap bmap = new BouzyMap(game.board);
            bmap.eval();
            Score score = game.getScore(bmap);

            statusScreen.displayScore(score);
//      Alert a = new Alert(LC._("Result"), score.scoreText, null, AlertType.INFO);
//      a.setTimeout(Alert.FOREVER);
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.