Branch: Tag:

1998-02-28

1998-02-28 19:56:42 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

permute added

Rev: lib/modules/Array.pmod:1.17
Rev: lib/modules/Calendar.pmod/Swedish.pmod:1.11

74:    return(arr);   }    + array permute(array a,int n) + { +  int q=sizeof(a); +  int i; +  a=a[..]; // copy    -  +  while (n && q) +  { +  int x=n%q; +  n/=q; +  q--; +  if (x) [a[i],a[i+x]]=({ a[i+x],a[i] }); +  i++; +  } +  +  return a; + } +    int search_array(mixed *arr, mixed fun, mixed ... args)   {    int e;