Public Class Form1
Private randarray() As String
Private num As Integer
Private Sub btnWords_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWords.Click
Dim snum As String
snum = InputBox("Enter number of words in array...")
Integer.TryParse(snum, num)
ReDim randarray(num)
'Assign words to array
For x = 1 To num
randarray(x) = InputBox("Enter word # " & x)
Next x
End Sub
Private Sub btnShuffle_Click(sender As System.Object, e As System.EventArgs) Handles btnShuffle.Click
Dim x, mix As Integer, temp As String
Dim randnum As Random = New Random()
'Swap the array indexes randomly
For x = num To 1 Step -1
mix = randnum.Next(1, x)
temp = randarray(mix)
randarray(mix) = randarray(x)
randarray(x) = temp
Next x
'Display all the rearranged array values one by one
For x = 1 To num
MessageBox.Show(randarray(x))
Next x
End Sub
End Class