无法在骰子滚轮应用程序的文本框中显示整数

Cannot get int to be displayed in text box for dice roller app

我正试图重新开始编程,但我无法将最终的 int 答案输入到最后的文本框中。我编码已经有几年了,所以如果我搞砸了很多时间,请告诉我。

     {
         int dice_total;
         int dice_num;
         int diff_num;
         int succ_num = 0;
         int ones = 0;
         Boolean comp_num = false;
         string Succ;
         string Comp;

         dice_total = int.Parse(Dice.Text);
         diff_num = int.Parse(Diff.Text);
         Random random = new Random();
         dice_num = random.Next(dice_total);
         
         if (dice_num >= diff_num)
         {
             succ_num++;
         }
         else
         {
             if (dice_num == 1)
             {
                 ones++;
             }
         }

         if (ones >= succ_num)
         {
             comp_num = true;
         }
         else
         {
             comp_num = false;
         }

         Succ = succ_num.ToString();
        
         Comp = comp_num.ToString();
         
         
     }```
[your text box name].Text=[some int].ToString();

例如:

label1.Text = product.BuyingPrice.ToString();

我似乎无法计算成功次数。对于那些不知道的人,WoD 让你掷 d10s 并且给你一个困难。您必须掷出该难度数字或更高的数字才能获得成功。如果 1 的数量多于(或等于)总成功数,则情况复杂。这甚至不包括当您掷出 10 时的代码(它让您再次掷出,同时仍然算作成功)。

例如。投掷难度为 6 的 5d10s 6、8、10、1、1 = 3 成功 再次滚动 10:1 总计:3 次成功和 1 次并发症

using Accord.Math.Distances;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Roller
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        int dice_total;
        int dice_add;
        int dice_num;
        int diff_num;
        int succ_num = 0;
        int ones = 0;
        Boolean comp_num = false;


        public void button1_Click(object sender, EventArgs e)
        {
 

            dice_total = int.Parse(Dice.Text);
            diff_num = int.Parse(Diff.Text);
            

            for (dice_add = 0; dice_add < dice_total; dice_add++)
            {
                Random random = new Random();
                dice_num = random.Next(dice_total);

                if (dice_num >= diff_num)
                {
                    succ_num++;
                }
                else
                {
                    if (dice_num == 1)
                    {
                        ones++;
                    }
                }

                if (ones >= succ_num)
                {
                    comp_num = true;
                }
                else
                {
                    comp_num = false;
                }

            }
            Succ.Text = succ_num.ToString();
            Comp.Text = comp_num.ToString();

        }


    }
}