SAIL - Reverse

Modding, patches, etc., for anyone who speaks neither Polish nor Czech.
Odpovědět
Uživatelský avatar
Morphid
Site Administrator
Site Administrator
Czech Republic
Příspěvky: 86
Registrován: sob pro 25, 2010 12:48 am
Bydliště: Czech Republic
Kontaktovat uživatele:

SAIL - Reverse

Příspěvek od Morphid »

This function reverses all values in the list that the first one will be last etc.

Kód: Vybrat vše

list:=[1,2,3,4,5,6];
list:=Reverse(list);
// list = [6,5,4,3,2,1];

Kód: Vybrat vše

export function Reverse(list);
var i;
begin
     result:=list;
     for i:=1 to list do
       result:=Replace(result, i, list[(list+1)-i]);
end;
Uživatelský avatar
YuriStriatov
Site Administrator
Site Administrator
Cuba
Příspěvky: 1395
Registrován: pát úno 17, 2006 3:02 am
Kontaktovat uživatele:

Re: SAIL - TurnValuesInList

Příspěvek od YuriStriatov »

Something like http://www.php.net/manual/en/function.array-reverse.php ?

Nice, but maybe better naming convention for function :P
Obrázek
Uživatelský avatar
Morphid
Site Administrator
Site Administrator
Czech Republic
Příspěvky: 86
Registrován: sob pro 25, 2010 12:48 am
Bydliště: Czech Republic
Kontaktovat uživatele:

Re: SAIL - Reverse

Příspěvek od Morphid »

thanks for your idea ;).. I corrected the name of this function
Odpovědět