Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub rerand_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rerand.Click
- Dim rand1, rand2, rand3, rand4, count, number As Integer
- Randomize()
- rand1 = 1 + Int(Rnd() * 6)
- rand2 = 1 + Int(Rnd() * 6)
- rand3 = 1 + Int(Rnd() * 6)
- rand4 = 1 + Int(Rnd() * 6)
- r1.Text = "ספרה מספר 1: " & rand1
- r2.Text = "ספרה מספר 2: " & rand2
- r3.Text = "ספרה מספר 3: " & rand3
- r4.Text = "ספרה מספר 4: " & rand4
- count = 1
- number = 0
- number += rand4 * count
- count *= 10
- number += rand3 * count
- count *= 10
- number += rand2 * count
- count *= 10
- number += rand1 * count
- num.Text = "המספר שהוגרל הוא: " & number
- If number > 5000 Then
- state.Text = "המספר גדול מ-5000"
- ElseIf number < 5000 Then
- state.Text = "המספר קטן מ-5000"
- Else
- state.Text = "המספר שווה ל-5000"
- End If
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim rand1, rand2, rand3, rand4, count, number As Integer
- Randomize()
- rand1 = 1 + Int(Rnd() * 6)
- rand2 = 1 + Int(Rnd() * 6)
- rand3 = 1 + Int(Rnd() * 6)
- rand4 = 1 + Int(Rnd() * 6)
- r1.Text = "ספרה מספר 1: " & rand1
- r2.Text = "ספרה מספר 2: " & rand2
- r3.Text = "ספרה מספר 3: " & rand3
- r4.Text = "ספרה מספר 4: " & rand4
- count = 1
- number = 0
- number += rand4 * count
- count *= 10
- number += rand3 * count
- count *= 10
- number += rand2 * count
- count *= 10
- number += rand1 * count
- num.Text = "המספר שהוגרל הוא: " & number
- If number > 5000 Then
- state.Text = "המספר גדול מ-5000"
- ElseIf number < 5000 Then
- state.Text = "המספר קטן מ-5000"
- Else
- state.Text = "המספר שווה ל-5000"
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement