Форум для тех, кто программирует под Android
-
Anonymous
Выбор рулетки
Сообщение
Anonymous »
Я использую алгоритм выбора рулетки для Android, используя код Bellow: < /p>
Код: Выделить всё
//int n=4;
//double [] weight = new double [n];
//weight[0]=9;
//weight[1]=8;
//weight[2]=10;
//weight[3]=1;
public void Roulette(double weight[],double max_weight){
int index=0;
while (true){
index= (int)(weight.length*Math.random());
if(Math.random()
Подробнее здесь: [url]https://stackoverflow.com/questions/48444314/roulette-selection[/url]
1752996569
Anonymous
Я использую алгоритм выбора рулетки для Android, используя код Bellow: < /p>
[code]//int n=4;
//double [] weight = new double [n];
//weight[0]=9;
//weight[1]=8;
//weight[2]=10;
//weight[3]=1;
public void Roulette(double weight[],double max_weight){
int index=0;
while (true){
index= (int)(weight.length*Math.random());
if(Math.random()
Подробнее здесь: [url]https://stackoverflow.com/questions/48444314/roulette-selection[/url]