Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Randomize()
- Dim str As String = " "
- Dim CaseVide As String = 15
- Dim random As New Random()
- Dim rnd As Integer
- For x As Integer = 0 To 100
- For j As Integer = 0 To 15
- Dim i As Integer = j
- If (CaseVide = j) Then
- If i > 3 And i < 12 Then
- rnd = random.Next(0, 4)
- If i Mod 4 = 3 Then
- Select Case rnd
- Case 0
- str += "" & CInt(i - 4)
- Case 1
- str += "" & CInt(i - 3)
- Case 2
- str += "" & CInt(i - 1)
- Case Else
- str += "" & CInt(i + 4)
- End Select
- ElseIf i Mod 4 = 0 Then
- Select Case rnd
- Case 0
- str += "" & CInt(i - 4)
- Case 1
- str += "" & CInt(i - 1)
- Case 2
- str += "" & CInt(i + 3)
- Case Else
- str += "" & CInt(i + 4)
- End Select
- Else
- Select Case rnd
- Case 0
- str += "" & CInt(i - 4)
- Case 1
- str += "" & CInt(i - 1)
- Case 2
- str += "" & CInt(i + 1)
- Case Else
- str += "" & CInt(i + 4)
- End Select
- End If
- ElseIf i <= 3 Then
- rnd = random.Next(0, 3)
- If i = 0 Then
- Select Case rnd
- Case 0
- str += "2"
- Case 1
- str += "4"
- Case 2
- str += "5"
- End Select
- ElseIf i = 3 Then
- Select Case rnd
- Case 0
- str += "1"
- Case 1
- str += "3"
- Case 2
- str += "8"
- End Select
- Else
- rnd = random.Next(0, 3)
- Select Case rnd
- Case 0
- str += "" & CInt(i - 1)
- Case 1
- str += "" & CInt(i + 1)
- Case Else
- str += "" & CInt(i + 4)
- End Select
- End If
- ElseIf i >= 12 Then
- rnd = random.Next(0, 3)
- If i = 12 Then
- Select Case rnd
- Case 0
- str += "9"
- Case 1
- str += "14"
- Case 2
- str += "16"
- End Select
- ElseIf i = 15 Then
- Select Case rnd
- Case 0
- str += "12"
- Case 1
- str += "13"
- Case 2
- str += "15"
- End Select
- Else
- rnd = random.Next(0, 3)
- Select Case rnd
- Case 0
- str += "" & CInt(i - 1)
- Case 1
- str += "" & CInt(i + 1)
- Case Else
- str += "" & CInt(i + 4)
- End Select
- End If
- End If
- str += " "
- CaseVide = CInt(str.ElementAt(str.Length - 2) & (str.ElementAt(str.Length - 1)))
- End If
- Next j
- Next x
- MsgBox(str)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement