官术网_书友最值得收藏!

Exercises

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.

  1. Using the std::rand() function with the modulo operator (%), for updating random_numbers.cpp to generate numbers that fall within the following ranges:
    • 0 to 1000
    • 150 to 600
    • 198 to 246
  2. 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.
  3. Have a look at your game collection and find out whether you can identify where procedural generation has been used.
  4. Which of the following are examples of procedural generation?
    • Loading a song
    • Ragdoll physics
    • Creating unique objects during the runtime
主站蜘蛛池模板: 宁海县| 莱芜市| 江门市| 龙岩市| 陵川县| 淄博市| 商南县| 科技| 莱西市| 会同县| 白水县| 镇坪县| 山阳县| 唐海县| 句容市| 资溪县| 肥东县| 手游| 额济纳旗| 张家界市| 宿迁市| 濮阳县| 潮州市| 手游| 宾川县| 嵊州市| 顺义区| 惠来县| 平远县| 桐柏县| 深泽县| 澄迈县| 晋州市| 天台县| 沙坪坝区| 藁城市| 乳山市| 岚皋县| 胶州市| 鹤峰县| 颍上县|