Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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