Skip to content

Instantly share code, notes, and snippets.

@illescasDaniel
Last active October 23, 2016 19:42
Show Gist options
  • Save illescasDaniel/2d3aa5a6e76f982c6517cc6ba1d86293 to your computer and use it in GitHub Desktop.
Save illescasDaniel/2d3aa5a6e76f982c6517cc6ba1d86293 to your computer and use it in GitHub Desktop.
Throw dice [C++]
#include <iostream>
#include <random>
using namespace std;
int main() {
random_device rd;
mt19937 rng(rd());
uniform_int_distribution<> dice(1, 6);
cout << dice(rng) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment