Author: SerpentSerpent pisze: ↑czw maja 14, 2020 9:33 pm Funkcja ustawia elementy zadanej tablicy w losowej kolejności.
Kod: Zaznacz cały
Export Function Shuffle(array); var i, index; begin result := []; if not array then exit; Randomize; for i = array downto 1 do begin index := rand(1, array); result := Insert(result, result + 1, array[index]); array := Delete(array, index); end; End;
Topic: viewtopic.php?f=42&t=6204