title: Write a method to shuffle a deck of cards in VB.NET
body: <p>I have a standard deck of 52 cards is represented in an array. Each card is represented as an integer. I wrote the below function to shuffle the cards. Does the code below look ok?</p>
  
  <pre><code>Module Module3
  
  Sub Main()
  
      ' initialize array
      Dim Cards(52) As Integer
  
      ' Unit Test
      ' Pass array as argument.
      Console.WriteLine(shuffle(Cards))
  
  End Sub
  
  Function shuffle(ByVal Cards() As Integer)
  
      Dim counter = 1
      Dim rand = New Random()
  
      For Each card In Cards
  
          ' Grab random number with range of 52
          Dim n = rand.Next(52)
  
          ' Pick a card
          Dim temp = Cards(counter)
  
          ' Swap picked card with random card
          Cards(counter) = Cards(n)
          Cards(n) = temp
  
          counter += 1
  
      Next
  
      Return (Cards)
  
  End Function
  
  End Module
  </code></pre>