Skip to content

Instantly share code, notes, and snippets.

@davespanton
Created October 10, 2011 20:48
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