In the world of computers, random can actually mean pseudo-random. Thus, when we send the same seed value to the random number generator it will always return the same output. This is why games with random elements, especially roguelikes, usually take special precautions to insert some type of ‘noise’ into the random number generator to produce a better emulation of randomness.
[spoiler=Example][tt]#include
#include
using namespace std;
int main() {
for (int x=1;x<5;x++){
cout << rand() << endl;
}
}[/tt]
For example, if you compile and run that code several times you’ll see that you always see the exact same ‘random’ numbers from rand(). Doesn’t matter how many times you run it. It will always return the same numbers, because rand() is starting with the same seed value.
[/spoiler]