Exemplo n.º 1
0
        public static int win_func(int wind, int i, int j, object tag, int their, int q1,int q2)
        {
            string temp;
            if ("" + but[i * param.lim + j].Tag == "" + tag)
            {
                wind++;
                if (wind == 5)
                {
                    for (int ii = 0; ii < param.countheight; ii++)
                        for (int jj = 0; jj < param.countwidth; jj++)
                            but[ii * param.lim + jj].Text = "";

                    if ((int)tag == their)
                    {
                        temp = "Вы победили!!!";
                        param.win++;
                    }
                    else
                    {
                        temp = "Победил противник!!!";
                        param.los++;
                    }
                    if ((MessageBox.Show(temp + " Хотите еще раз?", "Результат", MessageBoxButtons.YesNo).ToString() == "Yes"))
                    {
                        GameII.ActiveForm.Close();
                        GameII game = new GameII();
                        game.ShowDialog();
                    }
                    else
                        GameII.ActiveForm.Close();
                    return 1000;
                }
                return wind;
            }
            else
                return 0;
        }
Exemplo n.º 2
0
 private void game_ii_Click(object sender, EventArgs e)
 {
     GameII game = new GameII();
     game.ShowDialog();
 }