Exemple #1
0
    public void Solve()
    {
        if (!_sudokuController.HasStartedPuzzle())
        {
            return;
        }

        _sw = new Stopwatch();
        _sw.Start();
        _timesBacktracked = 0;

        _cells = _sudokuController.sudokuInstance.cells;
        // Task.Run(() => ContinueSolve(0));
        ContinueSolve(0);
    }
Exemple #2
0
    public void Init(Cell newCell)
    {
        cell = newCell;
        if (_sudokuController.HasStartedPuzzle())
        {
            _cellButton.onClick.AddListener(EnterNumberSelect);
        }

        _numberButtons = numberSelector.GetComponentsInChildren <Button>().ToList();
        for (var i = 0; i < _numberButtons.Count; i++)
        {
            var number = i;
            _numberButtons[number].onClick.AddListener(() => SelectNumber(number));
        }

        RenderCell();
    }