Skip to content

Instantly share code, notes, and snippets.

@andrey-malets
Created July 13, 2016 10:37
Show Gist options
  • Save andrey-malets/c21bd799b2703a4b4822e525fcec0078 to your computer and use it in GitHub Desktop.
Save andrey-malets/c21bd799b2703a4b4822e525fcec0078 to your computer and use it in GitHub Desktop.
#include <array>
#include <cassert>
#include <random>
#include <unistd.h>
int main(int ac, char* av[]) {
std::mt19937_64 e;
if (ac == 2) {
e.seed(std::stoi(av[1]));
}
while (true) {
std::array<std::uint_fast64_t, (2 << 16 >> 3)> output;
for (auto& i : output) {
i = e();
}
auto size = sizeof(output[0]) * output.size();
assert(write(1, output.data(), size) == size);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment