Ex 36 - Efficiency question

I’m working on Exercise 36, where you design your own game. I can’t find a better way to design conversation trees than a bunch of nested if-else statements that would branch off, but the book recommends not nesting if statements more than 2 deep if you can avoid it. Is there a more efficient/readable way?

Honestly that’s too much work for that exercise. If you have a slightly different game that works then it’s time to move on. You could waste years at that point and never learn more important things that are later in the book.

1 Like