c# dice roll (i <= maxRolls)
<p>I have two issues that I'm not sure how to fix.</p>

<p><code>diceThrow()</code> is supposed to randomly roll a die and come up with an answer 1-6 multiple times, but only comes up with one 1-6 answer and only does that. i.e. (6, 6, 6, 6, 6, 6, etc)</p>

<p>and for <code>rollDice()</code>, I'm not sure if I just poorly defined "<code>i</code>" or <code>maxRolls</code>, but it should be that when <code>i &gt; maxRolls</code>, the program should end and reset.</p>

<p>Any advice on how to fix either of these is greatly appreciated, thanks!</p>

<pre><code>//somewhere else in code
    int maxRolls = RollsNumber();
    int throwresult = diceThrow();
    int i;
//*******************************

    private void rollButton_Click(object sender, EventArgs e)
    {
        rollDice();
        wagerTextBox.Text = null;
        wagerTextBox.Text = scoreTextBox.Text;
        diceThrow();

        MessageBox.Show(Convert.ToString(throwresult));

        if (maxRolls &lt; i)
        {
            MessageBox.Show("You got too greedy.");

           //reset the form

        }
    }
    // Decides the maximum number of rolls before the player loses
    static public int RollsNumber()
     {
        Random rolls = new Random();
        return rolls.Next(1, 10);

    }
    // Throws the dice
    static public int diceThrow()
    {
        Random dice = new Random();
       return dice.Next(1, 7);
    }
    private void rollDice()
    {
        for (i = 0; i &lt;= maxRolls; i++)
        {

                int wager = Convert.ToInt32(wagerTextBox.Text);


                int score = wager * 100;


                scoreTextBox.Text = Convert.ToString(score);



        }  
    }
</code></pre>

<p>}
}</p>
