Help for this page

Select Code to Download


  1. or download this
    # swap $index1 and $index2 of @array
    $temp=$array[$index2];
    $array[$index2]=$array[$index1];
    $array[$index1]=$temp;
    
  2. or download this
    # step $index in $dir direction in @array circular
    $index+=$dir;
    $index=0 if $index>=@array;
    $index=@array-1 if $index<0;