Package pl.michalostruszka.gameoflife.board

Examples of pl.michalostruszka.gameoflife.board.Board


    public GameOfLife(Board initialState) {
        currentState = initialState;
    }

    public GameOfLife() {
        currentState = new Board();
    }
View Full Code Here



    @Test
    public void newGameShouldHaveEmptyState() throws Exception {
        GameOfLife game = new GameOfLife();
        Board currentBoard = game.currentBoardState();
        assertThat(currentBoard).isEqualTo(EMPTY_BOARD);
    }
View Full Code Here

    }

    @Test
    public void shouldEvaluateNextBoardState() throws Exception {
        board = Board.seedWith(LiveCell.at(0, 0), LiveCell.at(1, 0), LiveCell.at(1, 1));
        Board next = board.nextState();
        assertThat(next.liveCells()).containsOnly(LiveCell.at(0, 0), LiveCell.at(0, 1), LiveCell.at(1, 1), LiveCell.at(1, 0));
    }
View Full Code Here

TOP

Related Classes of pl.michalostruszka.gameoflife.board.Board

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.