7 /* x and y can be -1 */
10 unsigned int i
, row
, matches
= 0;
13 for ( row
= 0; row
< n
- m
+ 1; row
++ ) {
17 /* Iterate through results on the same row */
20 x
= aho( row
, x
, 0, n
- m
);
24 // printf("x row %i column %i\n",row, x);
26 /* If a row is found, check the m - 1 rows underneath it for matches */
29 for ( i
= 1; i
< m
; i
++) {
30 /* Optimization: instead of checking against n chars on
31 subsequent rows, just check against the next m chars after x */
32 y
= aho( row
+ i
, x
, i
, x
+ m
);
36 // printf("y row %i column %i\n",row + i, y);
41 /* If we reached to the final line above x without breaking, we have a match */
45 /* After each attempt,increase the counter + 1 */
50 printf("Bird: %i\n",matches
);