Пример #1
0
    public void startGame()
    {
        sudokuBoard = GameObject.FindObjectOfType<SudokuBoard>();
        modPanel = GameObject.FindObjectOfType<ModifierPanel>();

        modPanel.reset();
        sudokuBoard.instantiateBoard();
        populateBoard(level);
        sudokuBoard.checkBoard();
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        sudokuBoard = GameObject.FindObjectOfType<SudokuBoard>();
        modPanel = GameObject.FindObjectOfType<ModifierPanel>();

        sudokuBoard.instantiateBoard();
        int[] modifiers = createModifiers(4);
        foreach (int mod in modifiers)
        {
            int x = Random.Range(0, 9);
            int y = Random.Range(0, 9);

            while (sudokuBoard.getValue(x, y) - mod < 0 || sudokuBoard.getValue(x, y) - mod > 8)
                x = Random.Range(0, 9);
                y = Random.Range(0, 9);

            sudokuBoard.initializeMod(mod, x, y);
            modPanel.addMod(mod);
        }
    }