Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub shuffleArray(arr As Image())
- Dim n As Integer = arr.Length
- Dim ran As New Random
- For i = 0 To arr.Length - 1
- swap(arr, i, i + ran.Next(n - i))
- Next
- End Sub
- Public Sub swap(array As Image(), a As Integer, b As Integer)
- Dim temp As Image = array(a)
- array(a) = array(b)
- array(b) = temp
- End Sub
- Public Sub loadImages(images As Image())
- shuffleArray(images)
- For Each pb As PictureBox In cb 'Loops through all pictureboxes and fills them with an image.
- pb.BackgroundImage = images(i)
- pb.BackgroundImageLayout = BackgroundImageLayout.Stretch
- i += 1
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement