```
The Windows rand() function is quite a lot worse than merely having a low maximum value. It's an ordinary Linear Congruential Generator, which means you only need three consecutive values to be able to predict its entire future output.
```

Given the numbers 13050, 4267, 25352, construct the equations

4267 = (13050a+c) % 32768

25352 = (4267a+c) % 32768

Solving for a and c gives

a = 20077

c = 12345

Which means the next number that should be spat out is (25352×20077+12345) % 32768 = 19105 -- which indeed it is.

It's not the small rand_max that breaks the algorithm, it's a weakness in the LCG algorithm itself. It's designed for when you only want a few kinda-random numbers occasionally, not if you want to generate any random-looking data.