Package pair.gameoflife.a20140102

Examples of pair.gameoflife.a20140102.CoordTest$Coord


  protected void processEraseScreen(int eraseOption) throws IOException {
    getConsoleInfo();
    int[] written = new int[1];
    switch(eraseOption) {
    case ERASE_SCREEN:
      COORD topLeft = new COORD();
      topLeft.x = 0;
      topLeft.y = info.window.top;
      int screenLength = info.window.height() * info.size.x;
      FillConsoleOutputCharacterW(console, ' ', screenLength, topLeft, written);
      break;
    case ERASE_SCREEN_TO_BEGINING:
      COORD topLeft2 = new COORD();
      topLeft2.x = 0;
      topLeft2.y = info.window.top;
      int lengthToCursor = (info.cursorPosition.y - info.window.top) * info.size.x
        + info.cursorPosition.x;
      FillConsoleOutputCharacterW(console, ' ', lengthToCursor, topLeft2, written);
View Full Code Here


  protected void processEraseLine(int eraseOption) throws IOException {
    getConsoleInfo();
    int[] written = new int[1];
    switch(eraseOption) {
    case ERASE_LINE:
      COORD leftColCurrRow = info.cursorPosition.copy();
      leftColCurrRow.x = 0;
      FillConsoleOutputCharacterW(console, ' ', info.size.x, leftColCurrRow, written);
      break;
    case ERASE_LINE_TO_BEGINING:
      COORD leftColCurrRow2 = info.cursorPosition.copy();
      leftColCurrRow2.x = 0;
      FillConsoleOutputCharacterW(console, ' ', info.cursorPosition.x, leftColCurrRow2, written);
      break;
    case ERASE_LINE_TO_END:
      int lengthToLastCol = info.size.x - info.cursorPosition.x;
View Full Code Here

    @Test
    public void shouldSumSelfNeighbourCountAndNextNeighbourCount() {
        final int selfNeighbourCount = 2;
        final int nextNeighbourCount = 40;

        Coord selfCoord = new Coord(0, 0) {
            @Override
            public int oneForNeighbour(Coord other) {
                return selfNeighbourCount;
            }
        };
View Full Code Here

    @Test
    public void shouldNotCountTooFarNeighbourLeftOrUpAsAnyNeighbours() {
        assertThat(coords()
                .with(0, 2)
                .with(2, 0)
           .countNeighbours(new Coord(2, 2)), is(0));
    }
View Full Code Here

           .countNeighbours(new Coord(2, 2)), is(0));
    }

    @Test
    public void shouldCountSelfAsNeighbours() {
        assertThat(coords().with(2, 2).countNeighbours(new Coord(2, 2)), is(1));
    }
View Full Code Here

        private LinkedCoordsBuilder(LinkedCoords currentLinkedCoords) {
            this.currentLinkedCoords = currentLinkedCoords;
        }

        public LinkedCoordsBuilder with(int x, int y) {
            Coord coord = new Coord(x, y);
            OccupiedCoords linkedCoords = new OccupiedCoords(coord, currentLinkedCoords);
            return new LinkedCoordsBuilder(linkedCoords);
        }
View Full Code Here

            this.currentLinkedCoords = currentLinkedCoords;
        }

        public LinkedCoordsBuilder with(int x, int y) {
            Coord coord = new Coord(x, y);
            OccupiedCoords linkedCoords = new OccupiedCoords(coord, currentLinkedCoords);
            return new LinkedCoordsBuilder(linkedCoords);
        }
View Full Code Here

TOP

Related Classes of pair.gameoflife.a20140102.CoordTest$Coord

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.