hedgewars/uRandom.pas
changeset 7575 f415b3e0f3b9
parent 7389 15c3fb4882df
child 7577 bdbb072b38b9
equal deleted inserted replaced
7573:364cd923db43 7575:f415b3e0f3b9
    63 end;
    63 end;
    64 
    64 
    65 procedure SetRandomSeed(Seed: shortstring);
    65 procedure SetRandomSeed(Seed: shortstring);
    66 var i: Longword;
    66 var i: Longword;
    67 begin
    67 begin
    68 n:= 54;
    68 initModule;
    69 
    69 
    70 if Length(Seed) > 54 then
    70 if Length(Seed) > 54 then
    71     Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf
    71     Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf
    72 
    72 
    73 for i:= 0 to Pred(Length(Seed)) do
    73 for i:= 0 to Pred(Length(Seed)) do