Created
May 7, 2015 20:37
-
-
Save mkoryak/a0b2455c7b0948443792 to your computer and use it in GitHub Desktop.
circular index
This file contains hidden or 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
circularIndex = (idx, len) -> | |
return ((idx % len) + len) % len |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment