• توجه: در صورتی که از کاربران قدیمی ایران انجمن هستید و امکان ورود به سایت را ندارید، میتوانید با آیدی altin_admin@ در تلگرام تماس حاصل نمایید.

رسم بیست دایزه به صورت تصادفی

ahmadfononi

معاونت انجمن
Dim point1(41) As Single

Private Sub Command1_Click()
Dim X As Single, Y As Single, r As Single
For i = 1 To 40 Step 2
X = Rnd() * 10000
point1(i) = X
MsgBox (point1(i))
Y = Rnd() * 10000
point1(i + 1) = Y
r = Rnd() * 5000
Circle (X, Y), r
Next i
MsgBox (point1(3))
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If point1(1) < X < point1(2) And point1(3) < Y < point1(4) Then
MsgBox (1)
End If

If point1(4) < X < point1(5) And point1(6) < Y < point1(7) Then
MsgBox (2)
End If
If point1(8) < X < point1(9) And point1(10) < Y < point1(11) Then
MsgBox (3)
End If
If point1(12) < X < point1(13) And point1(14) < Y < point1(15) Then
MsgBox (4)
End If
If point1(16) < X < point1(17) And point1(18) < Y < point1(19) Then
MsgBox (5)
End If
If point1(17) < X < point1(18) And point1(19) < Y < point1(20) Then
MsgBox (6)
End If
If point1(21) < X < point1(22) And point1(23) < Y < point1(24) Then
MsgBox (7)
End If
If point1(25) < X < point1(26) And point1(27) < Y < point1(28) Then
MsgBox (8)
End If
If point1(29) < X < point1(30) And point1(31) < Y < point1(32) Then
MsgBox (9)
End If
If point1(33) < X < point1(34) And point1(35) < Y < point1(36) Then
MsgBox (10)
End If
If point1(37) < X < point1(38) And point1(39) < Y < point1(40) Then
MsgBox (11)
End If

End Sub​
 
بالا