Created
December 21, 2021 08:59
-
-
Save percybolmer/9cf014d54e7933d41d08d27b7b310f4f to your computer and use it in GitHub Desktop.
Copilot generated a shuffle func for us
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (d Deck) Shuffle() { | |
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