Uploaded May 2014 | Updated September 2026, 2 weeks ago
Today we learn how to use a random number generator so that we can use probability in our games!
NOTE: mt19937 is a much better choice than default_random_engine since you are guaranteed that it will be a good random engine. So instead of:
default_random_engine randomGenerator;
you type:
mt19937 randomGenerator;
And it should work fine! In fact, it is better to just always use mt19937 :)
en.wikipedia.org/wiki/Mersenne_Twister
cplusplus.com/reference/random/mt19937
Donate Via Paypal: goo.gl/ifsOMt
Twitter: twitter.com/ChillstepCoder
Seed Of Andromeda Channel: youtube.com/user/DubstepCoder
Seed Of Andromeda Website: seedofandromeda.com
Today we learn how to use a random number generator so that we can use probability in our games!
NOTE: mt19937 is a much better choice than default_random_engine since you are guaranteed that it will be a good random engine. So instead of:
default_random_engine randomGenerator;
you type:
mt19937 randomGenerator;
And it should work fine! In fact, it is better to just always use mt19937 :)
en.wikipedia.org/wiki/Mersenne_Twister
cplusplus.com/reference/random/mt19937
Donate Via Paypal: goo.gl/ifsOMt
Twitter: twitter.com/ChillstepCoder
Seed Of Andromeda Channel: youtube.com/user/DubstepCoder
Seed Of Andromeda Website: seedofandromeda.com







![C++/Game Tutorial 27: new, delete, and delete[]
In this episode we learn how to allocate variables on the heap using the new operator, and how to delete them from the heap with delete or delete[]! We also learn a little more about the difference between a by reference parameter and a pointer, and we learn that we should use nullptr instead of NULL :)
Twitter: https://twitter.com/ChillstepCoder
Seed Of Andromeda Channel: https://www.youtube.com/user/DubstepCoder
Seed Of Andromeda Website: http://www.seedofandromeda.com/ C++/Game Tutorial 27: new, delete, and delete[]](https://i.ytimg.com/vi/LMpkhZc17Z0/mqdefault.jpg)


