Last active
May 22, 2016 14:45
-
-
Save fupslot/340e6d4fb5d3e869471dcb46f6adbad8 to your computer and use it in GitHub Desktop.
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
var currentIndex = 0; | |
var listLength = 9; | |
var dir = 1; // -1 - to go backwards | |
var nextIndex = ((currentIndex + listLength) + dir) % listLength; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment