Miscellany
public text v1 · immutableint match(const char word[])
{
int i, n, e, runner=0;
char matchword[20];
for(i=0;i<10;i++)
{
for(n=0;n<strlen(strings[i]);n++)
{
if(strcmp(strings[i][n],word[0])==0)
{
for(e=0;e<strlen(word);e++)
{
if(strcmp(strings[i][n+runner],word[e])==0)
{
match=match+1;
}
runner=runner+1;
if(match == strlen(word))
{
strcpy(matchword, strings[i]);
return i;
printf(" (matches \"%s\")\n", matchword);
}
}
}
}
}
if(match!=strlen(word))
{
return -1;
printf(" No Match\n");
}
}