NXC RNG: Mersenne Twister
Here’s an example use of my implementation of the MT19937 Pseudo-Random Number Generator algorithm for NXC:
#include "MersenneTwister.h.nxc" #include "random_ul.h.nxc" #include "uniform_int.h.nxc" #define MAX 10 task main() { MT_srand(); NumOut(0, 0, urand(MAX)); Wait(2000); }
The repository/sources can be found here.
First!
Kidding.
Hey, Uh, this is kinda off-topic, but…
Hai, it’s me, 2Tie.
I could possibly finish up my Mario engine…
And I see that there’s another one (or two?) finished already, but…
I kinda have the motivation to finish it now.
Would you want me to?
2Tie said this on July 25, 2011 at 8:40 pm |
Sure, if you want. 🙂 You should ask at the MindBoards forums; you’ll get more enthusiasm from others than you just got from me. 😉
EDIT: Looks like you already did that!
muntoo said this on July 26, 2011 at 8:19 pm |
hi muntoo,
where can I find the Mersenne Twister library?
HaWe said this on December 2, 2011 at 3:42 am |
Sorry for taking so long to reply. The NXC RNG library contains an implementation for MT19937.
muntoo said this on December 26, 2011 at 1:07 am |