app/src/main/java/sudoku/Gui.java
private void doColorTextFields(JPanel panel, SudokuSolver s) {
        boolean penDown = false;
        int boxSize = (int) Math.sqrt((int) s.getDimension());
        int boxRowSwitch = boxSize * s.getDimension();
        for (int i = 0; i < Math.pow(s.getDimension(), 2); i++) {
            if (i % boxSize == 0 &&  
                (i % s.getDimension() != 0 || 
                 (boxSize % 2 != 0 && i % boxRowSwitch == 0) || 
                 (boxSize % 2 == 0 && i % boxRowSwitch != 0))) {
                penDown = !penDown;
            }
            Component tf = panel.getComponent(i);
            Color color = penDown ? Color.PINK : Color.WHITE;
            tf.setBackground(color);      
        }
    }
// like I did. It will make sense, trust me.
like I did. It will make sense, trust me.
like I did . It will make sense trust me .
private void doColorTextFields(JPanel panel, SudokuSolver s) {
        boolean penDown = false;
        int boxSize = (int) Math.sqrt((int) s.getDimension());
        int boxRowSwitch = boxSize * s.getDimension();
        for (int i = 0; i < Math.pow(s.getDimension(), 2); i++) {
            if (i % boxSize == 0 &&  
                (i % s.getDimension() != 0 || 
                 (boxSize % 2 != 0 && i % boxRowSwitch == 0) || 
                 (boxSize % 2 == 0 && i % boxRowSwitch != 0))) {
                penDown = !penDown;
            }
            Component tf = panel.getComponent(i);
            Color color = penDown ? Color.PINK : Color.WHITE;
            tf.setBackground(color);      
        }
    }
private void doColorTextFields ( JPanel panel , SudokuSolver s ) { boolean penDown = false ; int boxSize = ( int ) Math . sqrt ( ( int ) s . getDimension ( ) ) ; int boxRowSwitch = boxSize * s . getDimension ( ) ; for ( int i = 0 ; i < Math . pow ( s . getDimension ( ) , 2 ) ; i ++ ) { if ( i % boxSize == 0 && ( i % s . getDimension ( ) != 0 || ( boxSize % 2 != 0 && i % boxRowSwitch == 0 ) || ( boxSize % 2 == 0 && i % boxRowSwitch != 0 ) ) ) { penDown = ! penDown ; } Component tf = panel . getComponent ( i ) ; Color color = penDown ? Color . PINK : Color . WHITE ; tf . setBackground ( color ) ; } }
like I did.
like I did .