Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created December 21, 2021 09:00
Show Gist options
  • Save percybolmer/820db4a7b2e02255891da73de5e925c9 to your computer and use it in GitHub Desktop.
Save percybolmer/820db4a7b2e02255891da73de5e925c9 to your computer and use it in GitHub Desktop.
A fix for its function
func (d Deck) Shuffle() {
rand.Seed(time.Now().UnixNano())
for i := range d {
j := rand.Intn(len(d) - 1)
d[i], d[j] = d[j], d[i]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment