Skip to content

Instantly share code, notes, and snippets.

@schwern
Last active January 29, 2017 02:09
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 schwern/817105c33a27d225fa453f5017974c8f to your computer and use it in GitHub Desktop.
Save schwern/817105c33a27d225fa453f5017974c8f to your computer and use it in GitHub Desktop.
#include <math.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
static inline bool flip() {
return rand() % 2 ? true : false;
}
int main() {
for(int i = 1; i <= 400000000; i++) {
const char *key1 = flip() ? "NM" : "XR";
const char *key2 = flip() ? "NM" : "XR";
const int num1 = rand() % 10000000;
const int num2 = rand() % 10000000;
int num3 = rand();
if( flip() ) {
num3 *= -1;
}
printf(
"%s_%d,%s_%d,%d\n",
key1, num1,
key2, num2,
num3
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment