Skip to content

Instantly share code, notes, and snippets.

@st98
Last active August 29, 2015 14:13
Show Gist options
  • Save st98/d1162ad618fba322e85d to your computer and use it in GitHub Desktop.
Save st98/d1162ad618fba322e85d to your computer and use it in GitHub Desktop.
./r 1 2:10
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *s;
int i, n;
for (i = 1; i < argc; i++) {
n = (strchr(argv[i], ':')) ? strtol(s + 1, (char**) NULL, 10) : 32;
srand(strtol(argv[i], (char**) NULL, 10));
for (;n--;) {
printf("%d ", rand());
}
putchar('\n');
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment