Skip to content

Instantly share code, notes, and snippets.

@lettergram
Created October 25, 2015 19:01
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/f6cfb2686c7da95cf611 to your computer and use it in GitHub Desktop.
Save lettergram/f6cfb2686c7da95cf611 to your computer and use it in GitHub Desktop.
Determines cycles between current and initial deck configuration
# 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