Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Sort
- Dim a As Integer
- Dim b As Integer
- Dim c As Integer
- Private Sub Sort_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Randomize()
- txtNum1.Text = CInt(Rnd() * 10)
- txtNum2.Text = CInt(Rnd() * 10)
- txtNum3.Text = CInt(Rnd() * 10)
- txtNum4.Text = CInt(Rnd() * 10)
- txtNum5.Text = CInt(Rnd() * 10)
- txtNum6.Text = CInt(Rnd() * 10)
- txtNum7.Text = CInt(Rnd() * 10)
- txtNum8.Text = CInt(Rnd() * 10)
- txtNum9.Text = CInt(Rnd() * 10)
- txtNum10.Text = CInt(Rnd() * 10)
- End Sub
- Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
- c = 1
- Do Until c = 30
- If txtNum1.Text = 10 Then
- a = txtNum1.Text
- b = txtNum2.Text
- txtNum1.Text = b
- txtNum2.Text = a
- ElseIf (txtNum2.Text = 10) Then
- ElseIf txtNum1.Text > txtNum2.Text Then
- a = txtNum1.Text
- b = txtNum2.Text
- txtNum1.Text = b
- txtNum2.Text = a
- End If
- If txtNum2.Text = 10 Then
- a = txtNum2.Text
- b = txtNum3.Text
- txtNum2.Text = b
- txtNum3.Text = a
- ElseIf (txtNum3.Text = 10) Then
- ElseIf txtNum2.Text > txtNum3.Text Then
- a = txtNum2.Text
- b = txtNum3.Text
- txtNum2.Text = b
- txtNum3.Text = a
- End If
- c = c + 1
- If txtNum3.Text = 10 Then
- a = txtNum3.Text
- b = txtNum4.Text
- txtNum3.Text = b
- txtNum4.Text = a
- ElseIf (txtNum4.Text = 10) Then
- ElseIf txtNum3.Text > txtNum4.Text Then
- a = txtNum3.Text
- b = txtNum4.Text
- txtNum3.Text = b
- txtNum4.Text = a
- End If
- If txtNum4.Text = 10 Then
- a = txtNum4.Text
- b = txtNum5.Text
- txtNum4.Text = b
- txtNum5.Text = a
- ElseIf (txtNum5.Text = 10) Then
- ElseIf txtNum4.Text > txtNum5.Text Then
- a = txtNum4.Text
- b = txtNum5.Text
- txtNum4.Text = b
- txtNum5.Text = a
- End If
- If txtNum5.Text = 10 Then
- a = txtNum5.Text
- b = txtNum6.Text
- txtNum5.Text = b
- txtNum6.Text = a
- ElseIf (txtNum6.Text = 10) Then
- ElseIf txtNum5.Text > txtNum6.Text Then
- a = txtNum5.Text
- b = txtNum6.Text
- txtNum5.Text = b
- txtNum6.Text = a
- End If
- If txtNum6.Text = 10 Then
- a = txtNum6.Text
- b = txtNum7.Text
- txtNum6.Text = b
- txtNum7.Text = a
- ElseIf (txtNum7.Text = 10) Then
- ElseIf txtNum6.Text > txtNum7.Text Then
- a = txtNum6.Text
- b = txtNum7.Text
- txtNum6.Text = b
- txtNum7.Text = a
- End If
- If txtNum7.Text = 10 Then
- a = txtNum7.Text
- b = txtNum8.Text
- txtNum7.Text = b
- txtNum8.Text = a
- ElseIf (txtNum8.Text = 10) Then
- ElseIf txtNum7.Text > txtNum8.Text Then
- a = txtNum7.Text
- b = txtNum8.Text
- txtNum7.Text = b
- txtNum8.Text = a
- End If
- If txtNum8.Text = 10 Then
- a = txtNum8.Text
- b = txtNum9.Text
- txtNum8.Text = b
- txtNum9.Text = a
- ElseIf (txtNum9.Text = 10) Then
- ElseIf txtNum8.Text > txtNum9.Text Then
- a = txtNum8.Text
- b = txtNum9.Text
- txtNum8.Text = b
- txtNum9.Text = a
- End If
- If txtNum9.Text = 10 Then
- a = txtNum9.Text
- b = txtNum10.Text
- txtNum9.Text = b
- txtNum10.Text = a
- ElseIf (txtNum10.Text = 10) Then
- ElseIf txtNum9.Text > txtNum10.Text Then
- a = txtNum9.Text
- b = txtNum10.Text
- txtNum9.Text = b
- txtNum10.Text = a
- End If
- Loop
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement