Hello
I am making a text-based game, and need some help with the choice system. Here's my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Text_Based_Zombie_Survival
{
class Program
{
static void Main(string[] args)
{
//Define variables
ConsoleKeyInfo keyInfo = Console.ReadKey();
char choice = keyInfo.KeyChar; //Get char typed
char a;
char b;
char c;
//Instructions
Console.WriteLine("INSTRUCTIONS:");
Console.WriteLine("In each scenario, you will be presented with three choices");
Console.WriteLine("Each choice corresponds to a letter(a,b,c)");
Console.WriteLine("For example, if you had to choose between a backpack, stick, or golfclub");
Console.WriteLine("a would be the backpack, b would be the stick, and c would be the golfclub");
Console.ReadKey();
Console.WriteLine("Have fun!");
//Introduction
Console.ReadKey();
Console.WriteLine("There is a zombie apocalypse");
Console.ReadKey();
Console.WriteLine("Will you survive?");
Console.ReadKey();
Console.WriteLine("There is only one way to find out. Push any key to continue");
Console.ReadKey();
//Begin Game
Console.WriteLine("You wake up");
Console.ReadKey();
Console.WriteLine("Looking outside, you see zombies all over your yard");
Console.ReadKey();
Console.WriteLine("You open your closet to grab a weapon");
Console.ReadKey();
Console.WriteLine("You see a rifle, baseball bat, and tennis racquet");
Console.ReadKey();
Console.WriteLine("Which do you pick?");
}
}
}
So what I want to do is make it so the user just has to type in the letters a,b, or c, and it initiates the set response. I keep getting conversion errors, however, and this is the latest method I tried using.