I am trying to write a draft kit for my upcoming fantasy hockey league and wanted to know if there was an easy way to do this.
For those of you who don't know, a snake draft is one in which the drafting order flips for every consecutive draft.
Round 1: Team1, Team2, Team3, Team4, Team5, Team6
Round 2: Team6, Team5, Team4, Team3, Team2, Team1
Round 3: Team1, Team2, Team3, Team4, Team5, Team6
...
Using the above example, is there a way that, if I am given pick #11 and I know that there are 6 teams, I can figure out that it was team 2? (should work for any number of teams)
Any ideas?
Suppose $t =$ number of teams, $r=$ round number, and $p=$ pick number. Then consider the equation:
$$p=t(r-1)+b$$
where $0 < b \leq t$. Since you're given $p$ and $t$, you can easily find $r$ and $b$. If $r$ is odd, then $b$ tells you what team drafted. if $r$ is even, the order is reversed, so $t-b+1$ gives you the team that drafted.
So in your example, $p=11$, $t=6$, so $11 = 6(2-1)+5$. Then $r$ is even, so $t-b+1 = 6-5+1 = 2 \rightarrow$ team 2