Created
October 25, 2015 19:01
-
-
Save lettergram/f6cfb2686c7da95cf611 to your computer and use it in GitHub Desktop.
Determines cycles between current and initial deck configuration
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
# Determines cycles between current and initial configuration | |
def cycles(post_round_one_deck): | |
group = [1] * len(post_round_one_deck) | |
for i in range(0, len(post_round_one_deck)): | |
index = i | |
while post_round_one_deck[index] != i: | |
index = post_round_one_deck[index] | |
group[i] += 1 | |
return group |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment