diff options
-rw-r--r-- | src/main.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -156,23 +156,20 @@ int main(int argc, char* argv[]) { srand((unsigned)seed); cursor = set; - while(len > 0) { - // Randomly select the number of character sets to advance through (max 10) + while((len--) > 0) { + // Randomly select the number of character sets to advance through int i = rand() % 10; - while(i > 0) { + while((i--) > 0) { // Loop - if(!cursor->next) { + if(!cursor->next) cursor = set; - } else { + else cursor = cursor->next; - } - i--; } // Randomly select an integer within the set size int rc = rand() % cursor->count; // Random char within set printf("%lc", cursor->chars[rc]); - len--; } printf("\n"); |