Exemple #1
0
        public SudokuPanel()
        {
            InitializeComponent();
            Model = new Sudoku();

            m_typeView = E_TYPE_VIEW.MESSAGE;
            m_freezSelection = true;
            m_messageTitre = "Game Over";
            m_message = "Me im winner";
            m_timer = new System.Windows.Forms.Timer();
            m_timer.Tick += new EventHandler(timer_Tick);
            m_timer.Interval = 1000;
            m_timer.Stop();
        }
Exemple #2
0
        public bool isValid()
        {
            if (!hasChanged)
                return m_valid;
            Sudoku temp = new Sudoku(this.m_line, this.m_col);

            for (int i = 0; i < m_line;i++ )
            {
                for (int j = 0; j < m_col;j++ )
                {
                    if(temp.IsValidUpdate(i,j,this.GetCell(i,j).CellValeur)){
                        temp.Update(i, j, this.GetCell(i, j));
                    }else{
                        m_valid = false;
                        return m_valid;
                    }
                }
            }
            m_valid = true;
            return m_valid;
        }