Page 1 of 1

randomly generated field values

Posted: Wed Aug 15, 2007 4:33 pm
by Faithe
The website I'm making is a SIM game, and one of the components involved are randomly generated "band members."
Each band member has twelve different skills, each skill given a ranking from 1-10.

I'd like to be able to write a script that allows me to create X number of randomly generated band members at the same time, each having their age, gender, and skill points generated and added into the database.

I would very much appreciate it if anyone could point me in the right direction towards accomplishing this :] I'd be happy to explain further, if needed.

Thanks.

Posted: Wed Aug 15, 2007 4:37 pm
by VladSun

Posted: Wed Aug 15, 2007 4:38 pm
by VladSun
Oops, double post :(

Posted: Wed Aug 15, 2007 5:37 pm
by Faithe
Oh, perfect. Why didn't I think of that? ;]

One other thing. Is there way to make it so there's a higher chance of getting say, 5-10, than there is of getting 1-5?

Posted: Wed Aug 15, 2007 5:48 pm
by hawleyjr
Create an array of the values that you want duplicating the values that you need to show more often then not a couple times and then use array_rand()