This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <random> | |
| int randomInRange(int min, int max, std::mt19937 &eng) { | |
| std::uniform_int_distribution<> distr(min, max); // define the range | |
| return distr(eng); | |
| } | |
| int main() { | |
| std::random_device rd; // obtain a random number from hardware |
NewerOlder