Skip to content

Instantly share code, notes, and snippets.

@Sreyas-Sreelal
Last active July 11, 2021 05:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sreyas-Sreelal/5481423046e0138d18d02e44e1e62363 to your computer and use it in GitHub Desktop.
Save Sreyas-Sreelal/5481423046e0138d18d02e44e1e62363 to your computer and use it in GitHub Desktop.
A pawn function to shuffle arrays
ShuffleArray( array[ ] , start = 0 , end = sizeof( array ) )//by Sreyas
for( new rand_index = random( end - start + 1 ) + start, i = start; i < end; ++i , rand_index = random( end - start + 1 ) + start )
array[ i ] = array[ rand_index ] + array[ i ] - ( array[ rand_index ] = array[ i ] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment