Last active
October 25, 2015 17:27
-
-
Save lettergram/89feb43eae7d2ce5b002 to your computer and use it in GitHub Desktop.
Run through game simulation
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
# 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