Sylvain Vedrenne

To content | To menu | To search

2011, October, 7

Autre code avec prettyprint (prettify)

    public byte popFirstValueForCell(int li, int co) {
        if (isCellFilled(li, co))
            return 0;
        for (byte v = 1; v <= 9; v++) {
            if (isCellValuePossible(li, co, v) && !isCellValueScreened(li, co, v)) {
                return v;
            } else {
                System.out.println("GridShadow.popFirstValueForCell() value "+v+" is screened in cell "+li+","+co);
            }
        }
        return 0;
    }

    public boolean setCellValueAt(int li, int co, byte value) {
        System.out.println("GridShadow.setCellValueAt(" + li + "," + co + "=>"
                + value + ")");

        cellFlags[offset + 9 * li + co] &= ~MASK_FOR_CURRENT_VALUE;
        cellFlags[offset + 9 * li + co] |= FLAG_CELL_READ_ONLY | value;

        // ligne
        for (int c = 0; c < 9; c++) {
            if (c != co) {
                if (!isCellFilled(li, c) && isCellValuePossible(li, c, value)) {
                    unsetCellValuePossible(li, c, value);
                    setCellValueScreened(li, c, value);
                    if (getNumberOfPossibleValues(li, c) == 0) {
                        /* DEAD END */
                        return true;
                    }
                }
            }
        }

2011, October, 6

Code using Prettify

package net.jankenpoi.sudokuki.ui.swing;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Icon;
import javax.swing.JFrame;

@SuppressWarnings("serial")
public class AboutAction extends AbstractAction {
        
        private JFrame parent;
        
        public AboutAction(JFrame parent, SwingGrid grid, String string, Icon iconHelpAbout,
                        String desc, Integer mnemonic) {
                this.parent = parent;
        }

        @Override
        public void actionPerformed(ActionEvent e) {
                AboutDialog dlg = new AboutDialog(parent);
                dlg.setVisible(true);
        }


}


Whatever

Whatever

日本語はすきですよ!

日本語はすきですよ!

2011, October, 4

Welcome! ようこそ!Bienvenue !

Welcome! ようこそ!Bienvenue !