Created
May 8, 2023 14:10
-
-
Save ssaurel/f6d30cb465e2cfd647f8ac345567ee63 to your computer and use it in GitHub Desktop.
shuffle method for a Flipping Bits Game on the SSaurel's Blog
This file contains 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
def shuffle(self): | |
for _ in range(self.level * self.level): | |
if random.random() > 0.5: | |
self.flipcol(random.randint(0, self.level - 1)) | |
else: | |
self.fliprow(random.randint(0, self.level - 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment