Skip to content

Instantly share code, notes, and snippets.

@BSVino
Created October 21, 2016 04:40
Show Gist options
  • Select an option

  • Save BSVino/fedd455e1dc885db8c62396f42be67b1 to your computer and use it in GitHub Desktop.

Select an option

Save BSVino/fedd455e1dc885db8c62396f42be67b1 to your computer and use it in GitHub Desktop.
#include <random>
int main(int argc, const char** args)
{
const int num_data = 255;
unsigned char data[num_data];
srand(0);
for (int k = 0; k < num_data; k++) {
data[k] = (unsigned char)rand();
}
for (int k = 0; k < num_data - 1; k++) {
data[k] /= data[k + 1];
}
return data[rand() % num_data];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment