Example #1
0
        private void GetPositions_Click(object sender, EventArgs e)
        {
            QueensPosition  queens    = new QueensPosition();
            List <Position> positions = queens.GetPositions();

            SetDGV(positions);
        }
Example #2
0
        private void DGV_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            QueensPosition  queens    = new QueensPosition();
            List <Position> positions = queens.GetPositions(new Position(e.ColumnIndex, e.RowIndex), out bool res);

            if (res)
            {
                SetDGV(positions);
            }
            else
            {
                MessageBox.Show("расстановка невозможна");
            }
        }