I am trying to make a dice program. So when you click roll, it is supposed to roll two dice and add the sums and that's the number you roll. I need some help with this windows form program. Here is some code:
private int totalRolls;
private void btnRoll_Click(object sender, EventArgs e)
{
totalRolls += 1;
System.Random Int1 = new System.Random((int)System.DateTime.Now.Ticks);
System.Random Int2 = new System.Random((int)System.DateTime.Now.Ticks);
int randomInteger1 = Int1.Next(1, 7);
int randomInteger2 = Int2.Next(1, 7);
lblNumberRolled.Text = randomInteger1.ToString() + randomInteger2.ToString();
The code for lblNumberRolled.Text
I don't think is right. That is the code to add both dice up to get final sum number of dice. But when I run it, it shows big numbers like 30 and stuff. It isn't adding or something.
The highest sum should be 12.