[.NET] 樂透問題
Dim i, j As Integer
Dim test(5) As Integer
Randomize()
test(0) = Int(54 * Rnd() + 1)
For i = 1 To 5
test(i) = Int(54 * Rnd() + 1)
For j = 0 To i - 1
While test(i) = test(j)
test(i) = Int(54 * Rnd() + 1)
End While
Next
Next i
這是產生6個隨機數的邏輯
現在想用6個label將產生的隨機數放進去
另外還有6個textbox讓使用者填入號碼
要如何讓button按下去後能完成和隨機數的比對
然後顯示出猜對幾個號碼?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.25.118.33
→
10/05 19:19, , 1F
10/05 19:19, 1F
推
10/14 20:11, , 2F
10/14 20:11, 2F
→
10/14 20:12, , 3F
10/14 20:12, 3F
→
10/14 20:12, , 4F
10/14 20:12, 4F
→
10/14 20:12, , 5F
10/14 20:12, 5F
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章