On 9/30/07, secretosamani <[EMAIL PROTECTED]> wrote:

> I'm trying to write a choose your own adventure program and I was
> wondering if a switch statement was the best choice. I suppose I could
> do a large amount of if/else statements, but I'd like it to be as
> simple as possible. Anyone have any ideas?

I would use a switch, it works very well for making state-based
decisions... and a game like this is basically a state-machine.

I would also look around and see what has been done before, you should
be able to find source code for text-based adventure games all over
the place (Hunt the Wumpus?), to get a basic idea of the design for
something like this.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to