So my application (obviously) rolls dice (virtually). I've got the sides of the dice working, so you could roll a 19835-sided dice and get a result. But I'm not exactly sure how to roll multiple dice using the same random.... <code below>
Public Class frmMain
Private Sub btnRollDice_Click(sender As Object, e As EventArgs) Handles btnRollDice.Click
Dim rnd = New Random()
Dim nextValue = rnd.Next(txtSides.Text)
lblRollResult.Text = nextValue.ToString
End Sub
End Class
So just so that way nobody gets confused, here's a list of the interactive items..
btnRolldice - button, working everything inside here
txtSides - enabled text box, used to limit the random to a certain number
lblRollResult - label that gives the result, no biggy
So I want to be able to use another text box to determine the number of dice rolled, and make sure it will give me different numbers using the same random. I appreciate any help, and if you'd like the finished product, email me <cornhater@gmail.com>
Public Class frmMain
Private Sub btnRollDice_Click(sender As Object, e As EventArgs) Handles btnRollDice.Click
Dim rnd = New Random()
Dim nextValue = rnd.Next(txtSides.Text)
lblRollResult.Text = nextValue.ToString
End Sub
End Class
So just so that way nobody gets confused, here's a list of the interactive items..
btnRolldice - button, working everything inside here
txtSides - enabled text box, used to limit the random to a certain number
lblRollResult - label that gives the result, no biggy
So I want to be able to use another text box to determine the number of dice rolled, and make sure it will give me different numbers using the same random. I appreciate any help, and if you'd like the finished product, email me <cornhater@gmail.com>