Example #1
0
        private void CleverBruteForceButton_Click(object sender, EventArgs e)
        {
            var numberOfWrongMoves = _game.CleverBruteForce();

            using var g = this.CreateGraphics();
            g.Clear(this.BackColor);
            _gameDrawer.Draw(g);

            MessageBox.Show($"Number of wrong moves was {numberOfWrongMoves}.");
        }
Example #2
0
        private void SolveButton_Click(object sender, EventArgs e)
        {
            using var g = this.CreateGraphics();
            g.Clear(this.BackColor);
            _gameDrawer.Draw(g);
            var result = _game.Solve();

            if (result is null)
            {
                MessageBox.Show("No more solutions found");
            }
            else
            {
                _gameDrawer.DrawMove(g, result);
            }
        }