Skip to content

Instantly share code, notes, and snippets.

@davespanton
Created October 10, 2011 20:48
Show Gist options
  • Save davespanton/1276483 to your computer and use it in GitHub Desktop.
Save davespanton/1276483 to your computer and use it in GitHub Desktop.
Wrapping array indexes
public function getWrappedIndex( index:int, length:int ):int
{
return ((index % length) + length) % length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment