Random Number generator

PM development, programming, hacking and all that fun stuff.
Post Reply

Random Number generator

Post by sean » November 10th, 2004, 01:21

Has anyone developed a decent way to do random numbers? I was thinking that you could use the clock register, and then just subtract and mod, or use some other algorithm, but I figured I would see if anyone thought of something brilliant and amazing! :)

Team Pokémé
Posts: 84
Joined: May 9th, 2004, 20:22

Random Number generator

Post by p0p » November 12th, 2004, 01:55

what are you coding ? :P


Random Number generator

Post by sean » November 13th, 2004, 01:53

well actually, I'm kinda working on a simple port of wars. I don't have a lot of time due to my classes and work, so it's going very slow.


Random Number generator

Post by guest » April 11th, 2005, 22:18

Why not try Fibonacci numbers? Actually they're an extremely poor source of random numbers so it depends how random you want them to be. They were used to make Elite though so they're definetly going to be useful if anyone creates PokeElite.

Team Pokémé
Posts: 94
Joined: January 10th, 2005, 13:06

Random Number generator

Post by Lupin » April 12th, 2005, 22:07

the 256hz timer is very usefull for generating random numbers... you can just add the timer value to a seed and you have your "random" number, you can make it even more random by rotating the byte left/right or doing other funky stuff with it ;)

User avatar
PM.net Staff
Posts: 34
Joined: October 1st, 2008, 01:38
Location: The Netherlands

Random Number generator

Post by Agilo » October 1st, 2008, 01:38

Haha, very late reply and all of you probably have made several random number generators by now but I still feel compelled to post here.

Anyway, I used an algorithm as described here:

I needed to modify it a little bit:

Post Reply