Re: [CODE] say spell thought

From: Mundi King (
Date: 11/28/98

thought of two problems,
the ofs adds one even if a match was found,
and, the nature of the for loop keeps checking
after finding a match, instead of starting over

while (*(lbuf + ofs)) {
  for (j = 0; *(syls[j].org); j++) {
    if (!strncmp(syls[j].org, lbuf + ofs, strlen(syls[j].org))) {
         strcat(buf, syls[j].news);
         ofs += strlen(syls[j].org);
         ofs-- /* to offset the ofs++ */
         /* to start the for loop over from the top */

i am not very confident this is the right idea,
i will have to test it tomorrow when i have had
some sleep,

Get your free address at

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST