There are several classic C routines that I would love to convert for use in
As3.
However, not being a C programmer, I am stumbling right now.
Can anyone offer some help with the following 2 routines???
The first is a method from a classic Regex matching routine and the second is a
recursive quicksort algorithm
/* match: search for regexp anywhere in the text*/
int match(char *regexp, char *text)
{
if (regexp[0] =='^')
return matchhere(regexp+1, text);
do { /* must look even if string is empty */
if (matchhere(regexp, text))
return 1;
} while (*text++ != '\0');
return 0;
}
void quicksort(int L, int u)
if (L>=u) return;
swap(L, radint(L, u));
m=L;
for (i=L+1;i<=u;i++)
if (x[i] < x[L])
swap(++m, i);
swap(L,m);
quicksort(L, m-1);
quicksort(m+1, u);
}
[f] www.flickr.com/photos/bitstream
[c] 416.668.0034
[w] www.bitstream.ca
--------------------------------------------
"...all improvisation is life in search of a style."
- Bruce Mau,'LifeStyle'
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org