Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahmedghazi/682ebbaa7b7c5a0520d624fde9b5a1c3 to your computer and use it in GitHub Desktop.
Save ahmedghazi/682ebbaa7b7c5a0520d624fde9b5a1c3 to your computer and use it in GitHub Desktop.
array loop
1st draw: [0,1,2,3]
2nd draw: [1,2,3,0]
3rd draw: [2,3,0,1]
4th draw: [3,0,1,2]
arr[i] = (arr[i]+1)%arr.length;
arr[i] = arr[ (i + 1) % arr.length ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment