Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

rng cpp

// Add thus to with the headers
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// Generate a function that will give values between l and r inclusive
auto dist = uniform_int_distribution<int>(l, r);
// get the random number using dist(rng);
 
PREVIOUS NEXT
Tagged: #rng #cpp
ADD COMMENT
Topic
Name
5+5 =