To enable you to test your knowledge of this chapter's content, here are a few exercises that you should work on. They are not imperative to the rest of the book, but working on them will help you access your strengths and weaknesses in the material covered.
Using the
std::rand()
function with the modulo operator (%), for updatingrandom_numbers.cpp
to generate numbers that fall within the following ranges:0 to 1000
150 to 600
198 to 246
Come up with a new way of generating a random seed during the runtime. There are lots of ways to do this. So be creative! In my solution, the first numbers were always similar. Find out whether you can generate a random seed that mitigates that.
Have a look at your game collection and find out whether you can identify where procedural generation has been used.
Which of the following are examples of procedural generation?
Loading a song
Ragdoll physics
Creating unique objects during the runtime