The higher the number is the better chance the name should have at being selected randomly.
So, if we have a few varialbles in the stride like
DALIST = ["tree",10,"dog",5,"blah",6];
"tree" should have a chance at being selected with the odds of 10 in 21 (all numbers added up).
dog odds are 5 in 21, and blah odds are 6 in 21 ..
anyways, I know I could just create a new list and add each name to it as many times as NUMBER is.. then find a random name from that list .. but that could take A LOOTTT of memory, adding tree to a list say 250 times adds up pretty quick... Im just wondering if theres some sort of function/algorithm I could use to do what im trying to accomplish WITHOUT having to create a new list and using the variable groups I can get .. which are name and number.
I currently have this code in place temp, which finds a random name from the strided list (looking at only the even numbers in the list, those being the names.)
CODE
integer GetEvenNumberFromlist() {
integer random = (integer)(randBetween(0,llGetListLength(DALIST)));
while((integer)(random & 1) != 0) {
random = (integer)(randBetween(0,llGetListLength(DALIST)));
}
return random;
}
function_later_in_the_script_:P() {
integer RandEvenNumber = GetEvenNumberFromlist();
string pickedname = llList2String(DALIST, RandEvenNumber);
}
but the problem with this code is, it doesnt use the numbers at all to determine the winner, and all have the same odds. I need to somehow incorporate the numbers in this code to determine the winner how i described in above writings.
Getting the name and attached number from the strided list saved in a string and integer is not hard for me, so thats no problem.
hope I didn't confuse you too much, maybe someone can help.. its almost 2AM and im hoping someone will come up with a logical answer by morning so I don't have to come up with my own solution

Thanks.