This commit is contained in:
Jay D Dee
2018-05-11 11:52:36 -04:00
parent 9edc650042
commit bfd1c002f9
27 changed files with 539 additions and 403 deletions

View File

@@ -31,11 +31,13 @@ int nextPerm( uint8_t n[], uint32_t count )
return 0;
for ( i = count - 1; i>0 && n[i - 1] >= n[i]; i-- );
tail = i;
tail = i;
if ( tail > 0 )
{
for ( j = count - 1; j>tail && n[j] <= n[tail - 1]; j-- );
evo_swap( &n[tail - 1], &n[j] );
evo_swap( &n[tail - 1], &n[j] );
}
for ( i = tail, j = count - 1; i<j; i++, j-- )
evo_swap( &n[i], &n[j] );