Skip to content

Instantly share code, notes, and snippets.

@schoentoon
Last active December 22, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schoentoon/6487278 to your computer and use it in GitHub Desktop.
Save schoentoon/6487278 to your computer and use it in GitHub Desktop.
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if (argc == 1) {
fprintf(stderr, "USAGE: %s [options]\n", argv[0]);
return 1;
}
srand(time(NULL));
printf("%s\n", argv[(rand()%(argc-1))+1]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment