Generating random numbers
You're reading a tutorial for SFML 1.6, which doesn't exist anymore in the latest version. Check out the latest tutorials.
Introduction
Generating pseudo-random numbers is not hard, especially with the rand and srand functions from the standard library. But you always end up writing helper functions, for getting a random number in a specific range, getting a float random number, etc. That's why SFML provides a helper class, sf::Randomizer, that defines some helper functions.
This document is more a reference than a real tutorial, all it does is showing you the sf::Randomizer functions.
Setting the seed
The first thing almost every people do in a program using random numbers, is initializing the seed to make sure the generated sequence will be different from one run to the other. SFML does it automatically at program startup, so you don't have to worry about it.
However, if you want to use a specific seed (for replaying a known sequence), you can use the SetSeed function :
You can also get the current seed :
Generating random numbers whithin specific ranges
sf::Randomizer provides two functions for generating random numbers in specific ranges.
The first one generates integers :
And the second one generates floats :
Conclusion
That's all about random numbers. These few functions should be enough for your needs ; however if you need a more complete and complex random number library, you can have a look at boost.random.
You can now go back to the tutorials index, or jump to the tutorials about the windowing package.