Package com.barrybecker4.puzzle.sudoku.model.board

Examples of com.barrybecker4.puzzle.sudoku.model.board.Cell


            }
        }

        if (foundSubset != null) {
            for (int i=0; i<cells.numCells(); i++) {
                Cell cell = cells.getCell(i);
                if (!matches.contains(i) && cell.getCandidates() != null) {
                    cell.getCandidates().removeAll(foundSubset);
                }
            }
        }
    }
View Full Code Here


            drawCurrentFocus(g, currentFocusLocation);
        }

        for ( int i = 0; i < len; i++ ) {
            for ( int j = 0; j < len; j++ ) {
                Cell c = board_.getCell(i, j);

                xpos = MARGIN + j * pieceSize;
                ypos = MARGIN + i * pieceSize;

                drawCell(g2, c, xpos, ypos, userEnteredValues.get(i, j));
View Full Code Here

    /** Check for cells we can set in the row outside the bigCell */
    private void checkAndSetRowOutside(BigCell bigCell, int uniqueRow, int value) {

        for (int col = 0; col < board.getEdgeLength(); col++) {
            Cell cell = board.getCell(uniqueRow, col);
            if (!cell.isParent(bigCell)) {
                checkIfCanSetOutsideCellValue(value, cell);
            }
        }
    }
View Full Code Here

    /** Check for cells we can set in the column outside the bigCell */
    private void checkAndSetColOutside(BigCell bigCell, int uniqueCol, int value) {

        for (int row = 0; row < board.getEdgeLength(); row++) {
            Cell cell = board.getCell(row, uniqueCol);
            if (!cell.isParent(bigCell)) {
                checkIfCanSetOutsideCellValue(value, cell);
            }
        }
    }
View Full Code Here

        int n = board.getBaseSize();

        for (int row = 0; row < board.getEdgeLength(); row++) {
            for (int col = 0; col < board.getEdgeLength(); col++) {
                Cell cell = board.getCell(row, col);

                BigCell bigCell = board.getBigCell(row / n, col / n);
                CandidatesArray bigCellCands = getCandidatesArrayExcluding(bigCell, row % n, col % n);
                CandidatesArray rowCellCands = getCandidatesArrayForRowExcludingCol(row, col);
                CandidatesArray colCellCands = getCandidatesArrayForColExcludingRow(row, col);
View Full Code Here

     * Draw one of the tile paths which takes one of three forms.
     */
    public void drawPath(Graphics2D g2, int pathNumber, TilePlacement tilePlacement,
                         Point position, double size) {

        HexTile tile = tilePlacement.getTile();
        int pathStartIndex = getPathStartIndex(tile, pathNumber);

        int i = pathStartIndex + 1;

        PathColor pathColor = tile.getEdgeColor(pathStartIndex);
        while (pathColor != tile.getEdgeColor(i++)) {
            assert(i<6): "Should never exceed 6";
        }

        int pathEndIndex = i-1;
        int diff = pathEndIndex - pathStartIndex;
View Full Code Here

        this.numTiles = numTiles;
    }

    public TantrixBoard initialPosition() {
        //MathUtil.RANDOM.setSeed(1);
        return new TantrixBoard(new HexTiles().createRandomList(numTiles));
    }
View Full Code Here

    public boolean isGoal(TantrixBoard position) {
        return position.isSolved();
    }

    public TilePlacementList legalMoves(TantrixBoard position) {
        return new MoveGenerator(position).generateMoves();
    }
View Full Code Here

        HexTile tile = tilePlacement.getTile();
        int pathStartIndex = getPathStartIndex(tile, pathNumber);

        int i = pathStartIndex + 1;

        PathColor pathColor = tile.getEdgeColor(pathStartIndex);
        while (pathColor != tile.getEdgeColor(i++)) {
            assert(i<6): "Should never exceed 6";
        }

        int pathEndIndex = i-1;
View Full Code Here

     */
    private int getPathStartIndex(HexTile tile, int pathNumber) {
        Set<PathColor> set = new HashSet<PathColor>();
        int i = 0;
        do {
            PathColor c = tile.getEdgeColor(i++);
            set.add(c);
        } while (set.size() <= pathNumber);
        return i-1;
    }
View Full Code Here

TOP

Related Classes of com.barrybecker4.puzzle.sudoku.model.board.Cell

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.