lundi 25 mai 2015

pseudo random number generation

I am generating a random number in my game using:

System.Random rnd = new System.Random ();
int TileType = rnd.Next (0, 8);

The problem is that the numbers are too random. The numbers relate to tiles and i didn't get a particular tile for 20 rolls.

I need guidance on making a function that is generates "fake" random numbers. So basically I would like to make sure i generate each tile type in x rolls. I imagine 12 might be a good starting point for x but would like to be able to adjust x.

If anyone could point me in the right direction it would be greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire