News for hackers. Stuff that matters.
Re:How to program a text adventure in C (2016) by kbumsik on Sunday March 22, 2020 @10:33AM (#22655174)
> The array iteration code is also solid.

Shouldn't there be a NULL at the end of the array and do a null check in the iteration?

Re:How to program a text adventure in C (2016) by pm215 on Sunday March 22, 2020 @10:57AM (#22655326)
I think the last array entry {executeNoMatch , "A?"} will match on any string (and print the fallback "I don't know how to VERB" message), so it's impossible to fall off the end of the array. If you wanted to use a more defensive-programming style then you could add a sentinel of some kind and assert that you never hit it.