I'm curious, how do you write such a bug? Accidental early return in the comparison function or what?

So, in that particular game, I wanted to match a substring, since my data source includes some responses written as "let/allow" or "drive (vehicle)", which isn't realistic to expect the user to type. So, I just figured I would quickly work around that by allowing a substring match. However, I didn't really think about the edge cases all that much.

Yeah, I guess you should just split your source data into words.