Question about returning blocks of code.

Hello, I'm fairly new to c# and I wanted to do a text adventure thingy, vey simple stuff: the user writes down the options and the game reacts.

Now what I want to do is so that I can make the game choose from a list of options and have a random thing happening.

For example, the player goes to a cave, the game then choses between a dark cave and a lit cave and then presents an apropriate message aswell as options for the situation.

My question is how do I create these "blocks of code" I can then give them a name or a value to then let the game chose?

I've tried looking into helper methods and classes but they didn't work because I don't know what type of data they're storing.

It's not string since it's not just a text message.

Sorry if this might sound confusing I'd be happy to clarify it more for you if you ask to, and thanks for the help in advance.

by Eldirish via /r/csharp

Leave a Reply