コード例 #1
0
        public Form1()
        {
            InitializeComponent();

            MasterMindBoard       mmBoard  = new MasterMindBoard();
            MasterMindSecretBoard mmSecret = new MasterMindSecretBoard();
            MasterMindCheckBoard  mmCheck  = new MasterMindCheckBoard();



            for (int i = 0; i < 10; i++)
            {
                for (int k = 0; k < 2; k++)
                {
                    for (int l = 0; l < 2; l++)
                    {
                        AddCheckingButton(mmCheck, i, k, l);
                    }
                }
                AddRound(i);
                for (int j = 0; j < 4; j++)
                {
                    AddControl(mmBoard, i, j);
                    AddSecretFields(mmSecret, j);
                }
            }
        }
コード例 #2
0
        public void AddCheckingButton(MasterMindCheckBoard mmCheck, int i, int k, int l)
        {
            Field checkButton = new Field();

            checkButton.Location  = new Point(k * 30 + Btn_Green.Location.X, l * 30 + Btn_Green.Location.Y - (i * 61) - 61);
            checkButton.Size      = new Size(27, 27);
            checkButton.Text      = "[" + (k).ToString() + "," + (l).ToString() + "]"; // ROBOCZO - poźniej wykomentować
            checkButton.Font      = new Font("Arial", 6);
            checkButton.ForeColor = Color.Black;


            Controls.Add(checkButton);
        }