Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            scissors_Rock_Paper myChoice = scissors_Rock_Paper.Bawi;
            scissors_Rock_Paper pcChoice =
                (scissors_Rock_Paper) new Random().Next(3);

            myResult.Text = myChoice.ToString();
            pcResult.Text = pcChoice.ToString();

            if (myChoice == pcChoice)//바위
            {
                result.Text = "비김";
            }
            else if (pcChoice == scissors_Rock_Paper.Bo)
            {
                result.Text = "짐";
            }
            else
            {
                result.Text = "이김";
            }
        }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string[]            GBB      = { "가위", "바위", "보" };
            scissors_Rock_Paper myChoice = scissors_Rock_Paper.Bo;
            scissors_Rock_Paper pcChoice = (scissors_Rock_Paper) new Random().Next(3);

            myResult.Text = GBB[(int)myChoice];
            pcResult.Text = GBB[(int)pcChoice];

            if (myChoice == pcChoice)

            {
                result.Text = "비김";
            }
            else if (pcChoice == scissors_Rock_Paper.Gawi)   //가위
            {
                result.Text = "짐";
            }
            else
            {
                result.Text = "이김";
            }
        }