Help to build a twisted script... - 13/01/11 01:10 AM
Hi,
I need your science guys !
I need advice on how to "build" a script.
I have two parameters to evaluate : Rating AND Ranking
Let's say i have Names who received both Rating and Ranking Value.
Now let's say i have gifts to give depending of a specific rule for each gift... Twisted isn't it ? :o)
For exemple :
To obtain Gift1, people needs to have rating>0 and ranking>0 (means every participant can have Gift1)
To obtain Gift2, people needs to have rating>5 and ranking>50
To obtain Gift3, people needs to have rating>5 and ranking>100
To obtain Gift4, people needs to have rating>6 and ranking>20
To obtain Gift5, people needs to have rating>6 and ranking>500
To obtain Gift6, people needs to have rating>6 and ranking>1000
And so on...
Now we have poeple's name with both value (rating and ranking)
Name1 : Rating=5.2 and Ranking=153
Name2 : Rating=6.5 and Ranking=70
Name3 : Rating=8 and Ranking=300
So Name1 will win gift1 and gift2 and gift3
Name2 will win gift1 and gift2 and gift4 (!!!but not gift3)
Name3 will win gift1 and gift2 and gift3 and gift4
My previous idea, maybe stupid was to make :
*Hash table : rating.hsh with item=name and data=rating
name1 - 5.2
name2 - 6.5
name3 - 8
*Hash table : ranking.hsg with item=name and data=ranking
name1 - 153
name2 - 70
name3 - 300
*ini files : gift.ini
[gift]
rating_0_to_5=gift1
rating_sup_to_5=gift1;gift2
rating_sup_to_6=gift1;gift2;gift3;gift4;gift5
ranking_0_to_20=gift1
ranking_0_to_50=gift1;gift4;gift2
ranking_0_to_100=gift1;gift4;gift2
ranking_0_to_500=gift1;gift4;gift2;gift3
ranking_0_to_1000=gift1;gift4;gift2;gift3;gift5
ranking_sup_to_1000=gift1;gift2;gift3:gift4;gift5;gift6
Now i'd like to give rating and ranking of a name to the script and script tells me which gift i have to offer to this name.
Thx for advance to all people who will take time to answer me.
PS : Sorry for my english but i am a foreigner ;o)
Conscience.
I need your science guys !
I need advice on how to "build" a script.
I have two parameters to evaluate : Rating AND Ranking
Let's say i have Names who received both Rating and Ranking Value.
Now let's say i have gifts to give depending of a specific rule for each gift... Twisted isn't it ? :o)
For exemple :
To obtain Gift1, people needs to have rating>0 and ranking>0 (means every participant can have Gift1)
To obtain Gift2, people needs to have rating>5 and ranking>50
To obtain Gift3, people needs to have rating>5 and ranking>100
To obtain Gift4, people needs to have rating>6 and ranking>20
To obtain Gift5, people needs to have rating>6 and ranking>500
To obtain Gift6, people needs to have rating>6 and ranking>1000
And so on...
Now we have poeple's name with both value (rating and ranking)
Name1 : Rating=5.2 and Ranking=153
Name2 : Rating=6.5 and Ranking=70
Name3 : Rating=8 and Ranking=300
So Name1 will win gift1 and gift2 and gift3
Name2 will win gift1 and gift2 and gift4 (!!!but not gift3)
Name3 will win gift1 and gift2 and gift3 and gift4
My previous idea, maybe stupid was to make :
*Hash table : rating.hsh with item=name and data=rating
name1 - 5.2
name2 - 6.5
name3 - 8
*Hash table : ranking.hsg with item=name and data=ranking
name1 - 153
name2 - 70
name3 - 300
*ini files : gift.ini
[gift]
rating_0_to_5=gift1
rating_sup_to_5=gift1;gift2
rating_sup_to_6=gift1;gift2;gift3;gift4;gift5
ranking_0_to_20=gift1
ranking_0_to_50=gift1;gift4;gift2
ranking_0_to_100=gift1;gift4;gift2
ranking_0_to_500=gift1;gift4;gift2;gift3
ranking_0_to_1000=gift1;gift4;gift2;gift3;gift5
ranking_sup_to_1000=gift1;gift2;gift3:gift4;gift5;gift6
Now i'd like to give rating and ranking of a name to the script and script tells me which gift i have to offer to this name.
Thx for advance to all people who will take time to answer me.
PS : Sorry for my english but i am a foreigner ;o)
Conscience.