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

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
主站蜘蛛池模板: 米脂县| 威信县| 绍兴市| 礼泉县| 土默特左旗| 河间市| 托克逊县| 汉阴县| 武宁县| 玛曲县| 浙江省| 隆德县| 罗源县| 东兰县| 探索| 句容市| 木兰县| 黔南| 曲阜市| 江阴市| 舞阳县| 定日县| 隆子县| 兴文县| 张家界市| 封开县| 鱼台县| 利川市| 桂平市| 双桥区| 涪陵区| 德安县| 宁都县| 宿迁市| 鄄城县| 威海市| 扬中市| 威宁| 卢氏县| 承德县| 英吉沙县|