Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active October 25, 2015 17:27
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 lettergram/89feb43eae7d2ce5b002 to your computer and use it in GitHub Desktop.
Save lettergram/89feb43eae7d2ce5b002 to your computer and use it in GitHub Desktop.
Run through game simulation
# Run through game
def game(count):
deck = []
origDeck = []
ans = 0
# Generate deck and copy
for j in range(1, count + 1):
deck.append(j)
origDeck.append(j)
# Run through one round
deck = round(deck)
# Loop through until deck is life first
while deck != origDeck:
deck = round(deck)
ans += 1
return ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment