コード例 #1
0
        public void CrearSudoku(ref tableroSudoku s)
        {
            s = new tableroSudoku(5);

            int[,] arrayTablero = s.imprimeTablero();
            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    Label current = (Label)this.Controls.Find("C" + i + "_" + j, true)[0];
                    current.Text = arrayTablero[i, j].ToString();
                }
            }
        }
コード例 #2
0
        public void revelar(ref tableroSudoku s)
        {
            int[,] arrayTablero = s.casillasInversas();

            if (s.cantSoluciones(0, 0, 0) == 1)
            {
                imprimir(arrayTablero);
                solucionesExitosas++;
                solucionesTotales++;
                lblSolucion.Text = "Solución Única";
                lblExito.Text    = solucionesExitosas.ToString();
                lblTotales.Text  = solucionesTotales.ToString();
            }
            else
            {
                imprimir(arrayTablero);
                cantidadfallos++;
                solucionesTotales++;
                lblSolucion.Text = "Sin Solución Única";
                lblFallas.Text   = cantidadfallos.ToString();
                lblTotales.Text  = solucionesTotales.ToString();
            }
        }