#include #include #include "RNGT.h" #include using namespace std; int main() { RNGT rng1{1,20}, rng2{-100,100}; map counts; cout << "D20 Roll Test" << endl; for(int i = 0; i < 1'000'000; i++) { int roll = rng1(); ++(counts[roll]); } for(auto x = begin(counts); x!= end(counts) ; x++) { cout << setw(4) << x->first << setw(10) << x->second << endl; } cout << endl << endl; cout << "Some rand nunbers between " << rng2.Min() << " and " << rng2.Max() << endl; for(int i =0; i < 20; i++) { cout << rng2() << endl; } cout << endl << endl; cout << "Testing seed. There should be no errors" << endl; // test for starting values same with same seed. // RNGT rngA(1,1'000'000, 5); RNGT rngB(1,1'000'000, 5); for(int i = 0; i < 100; i++) { if (rngA() != rngB()) { cout << "Error, not the same " << endl; } } return 0; }