- or download this
char *strstr(char *s1, *s2 ) {
register char *p = s1;
...
}
return (0);
}
- or download this
// Assumes equal length ascii strings and no embedded nulls.
int fuzzyMatch( char *a, char *b ) {
...
while( *a ) if( !( *a++ - *b++ ) ) ++sum;
return sum;
}
- or download this
( $s[ $ai ] ^ $s[ $_ ] ) =~ tr[\0][\0]
- or download this
C:\test>fuzzy-b
Rate a b
a 7.33/s -- -20%
b 9.16/s 25% --
- or download this
#! perl -slw
use strict;
...
cgggttttttttttt
acctttttttttttt
ggggttttttttttt