A pseudorandom engine produces a sequence determined by its internal state. A seed selects the starting state. This is useful for repeatable experiments: if you restart the same kind of engine with the same seed and consume values in the same way, you can reproduce the run.
<random> separates an engine, which produces raw values, from a distribution, which maps those values to a useful range. std::mt19937 names one engine. std::uniform_int_distribution<int>(1, 6) describes equally likely integers from one through six, including both ends.
#include <iostream>
#include <random>
int main() {
std::mt19937 first(17);
std::mt19937 second(17);
std::uniform_int_distribution<int> left(1, 6);
std::uniform_int_distribution<int> right(1, 6);
bool same = left(first) == right(second);
std::cout << std::boolalpha << same << '\n';
}
In left(first), the distribution asks first for values and advances its state. A second call to left(first) continues the sequence; it does not restart it. To replay a sequence, initialize another engine with the same seed and make the same calls. The repeatability comparison uses two separately initialized engines and matching distributions, each consuming the same number of draws.
Do not memorize distribution-specific output numbers. Library implementations may map engine values differently. This lesson checks that two matching setups agree within the same run, and that each draw falls inside its requested range. It does not promise a particular sequence across every platform.
The editor first compares engine states with first == second, then checks six paired draws and a separate range probe. Equal engines have matching state. Checking the starting state distinguishes restarting a sequence from continuing an engine that has already advanced. Seed the second engine to match the first, then select the requested range for the independent draw. The fixed seed is intentional; no clock, device entropy, or unpredictable input is involved. This is practice with reproducible behavior, not a security-sensitive random generator.
Edit main.cpp; the supplied Console probes already call your code.
second with the same seed as first. Leave both matching distributions and the six-draw loop intact. Expect Repeatable: true.sample the inclusive range 3 through 8. Expect In range: true, without printing or depending on a particular draw.Use Run to inspect the Console, then Submit to check your work.