Beispiel #1
0
        public void ButtonPressed(byte input)
        {
            int row    = int.Parse(selectedButton.Name[3] + "");
            int column = int.Parse(selectedButton.Name[4] + "");

            if (input == 0)
            {
                Stat.Text = "N***a, you cannot put 0 in a sudoku";
                return;
            }

            ISudoku tmpSudo = sudo.Clone();

            tmpSudo.SetNumberAt(column, row, input);

            if (tmpSudo.IsSolvable())
            {
                sudokuArray[column, row] = (int)input;
                selectedButton.Content   = input;
                selectedButton.IsEnabled = false;
                sudo.SetNumberAt(column, row, input);
                Stat.Text = "GJ N***A";
                if (sudo.IsSolved())
                {
                    Stat.Text = "YOU DONE DID N***A, FRIED CHICKEN FOR EVERYONE!";
                }
                return;
            }
            else
            {
                Stat.Text = "N***A YOU STUPID AS HELL";
                return;
            }
        }