Just wondering if you guys think this is a good way to shuffle a deck or a bad way. Updated to show the GetRandom function as requested.
Private Sub DeckShuffle() ' shuffles the deck 4 times. For shufflingCards As Integer = 0 To 3 ' goes through each card and changes position once each time it goes through shufflingCards For shuffleEachCard As Integer = 0 To 51 ' gets a random number 0 - 51 Dim placeHolder As Integer = GetRandom(0, 51) ' creates a temporary card for swapping cards Dim tempCard As Card = deck(placeHolder) ' makes the random number card now the card we were shuffling deck(placeHolder) = deck(shuffleEachCard) ' replaces the card we were shuffling with the one we were saving as a temporary deck(shuffleEachCard) = tempCard Next Next End Sub ' Gets a random number for shuffling. Private Function GetRandom(ByVal Min As Integer, ByVal Max As Integer) As Integer Static Generator As System.Random = New System.Random() Return Generator.Next(Min, Max) End Function