Someone once asked me what I thought. During the lecture last night, I wrote this code. Which one thinks it is wrong? Thank you for your correction.
The code is written in accordance with the vs2010 specification.
Suppose you start by pressing the start1 button.
Suppose there are six labels for output. (Counting result)
Private sub start1_click ()
Dim sz1 as integer 'defines the integer variable sz1 used to store dice results
Dim a %, B %, C %, d %, E %, F % 'defines six Integer Variables A, B, C, D, E, F for statistical results
A = 0
B = 0
C = 0
D = 0
E = 0
F = 0
For I = 1 to 5000 'loops 5000 times
Sz1 = int (6-1 + 1) * RND + 1) 'generates a random number from 1 to 6.
Select case sz1
Case 1' if the result is 1, the variable A counts plus 1
A = a + 1
Case 2' if the result is 2, add 2 to the variable B count
B = B + 1
Case 3' if the result is 3, the variable c count plus 3
C = C + 1
Case 4' if the result is 4, the variable d count plus 4
D = d + 1
Case 5' if the result is 5, the variable e count is increased by 5
E = e + 1
Case 6' if the result is 6, the variable f count plus 6
F = f + 1
End Select
Next I
'Use the following statement to output the result to six tags:
Label1.Text = "roll out" & a & "times"
Label2.Text = "throwing two points" & B & "times"
Label3.Text = "three points" & c & "times"
Label4.text = "four points" & D & "times"
Label5.text = "5" & E & "times"
Label6.text = "" & F & "times"
End sub