Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            B = new BigCard(getRandomCard());
            var img2 = B.getCardImage();

            for (int i = 0; i < 5; i++)
            {
                imgB[i].Image = img2[i];
            }

            this.Text = $"{A.point},{B.point}";

            textBox1.Clear();
            textBox1.Text += "甲方:" + A.getPointType() + "\r\n";
            textBox1.Text += "乙方:" + B.getPointType() + "\r\n";
            if (A.point > B.point)
            {
                textBox1.Text += "A贏了" + "\r\n";
            }
            else if (B.point > A.point)
            {
                textBox1.Text += "B贏了" + "\r\n";
            }
            else
            {
                textBox1.Text += "平手" + "\r\n";
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.InitialDirectory = Directory.GetCurrentDirectory();
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                input1 = File.ReadAllText(ofd.FileName).Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
            }

            // card
            A = new BigCard(input1);
            var img1 = A.getCardImage();

            for (int i = 0; i < 5; i++)
            {
                imgA[i].Image = img1[i];
            }
        }