Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Created May 8, 2023 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/f6d30cb465e2cfd647f8ac345567ee63 to your computer and use it in GitHub Desktop.
Save ssaurel/f6d30cb465e2cfd647f8ac345567ee63 to your computer and use it in GitHub Desktop.
shuffle method for a Flipping Bits Game on the SSaurel's Blog
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