Hello! I wonder how to code a % rate!
For example! that i want 30 % chance to get a MSGBOX! how i will write then?
Printable View
Hello! I wonder how to code a % rate!
For example! that i want 30 % chance to get a MSGBOX! how i will write then?
VB.NET Code:
Dim rand As New Random If rand.NextDouble <= 0.3 Then MessageBox.Show("hello world") End If