View Single Post
Old 27.05.2007, 08:06   #5
TheTester
Архивный участник
 
Join Date: Oct 2006
Posts: 112
Default

Quote:
Originally Posted by Corund View Post
попробую объяснить алгоритм так:
x:=rand(100);
if x < P1 then summon
else if x < P1+P2 then summon
else if x < P1+P2+P3 then summon
else if x < P1+P2+P3+P4 then summon
ну и так далее
А как в конце? =)
Ситуация такая (речь о additional_make_multi_list): P1=30, P2=50 (в сумме не 100%).
Первый вариант:
Code:
x:=rand(100);
if x < P1 then summon(I1) else if x<P1+P2 then summon(I2) else exit;
Второй вариант:
Code:
x:=rand(100);
if x < P1 then summon(I1) else summon(I2);
TheTester is offline