When it gets to the part where the user gets asked a question, it skips over and closes, doesn't even print the stats of Donald at the end. I can't seem to figure out why, even with read key it does not work.
using System;
namespace ConsoleApp2
{
class Donald
{
public static int Health = 100;
public static int Damage = 50;
public static int Speed = 15;
public static string Food;
public static string Potion;
}
class Program
{
static void Main(string[] args)
{
Console.Write("What will Donald eat?: ");
Donald.Food = Convert.ToString(Console.Read());
Console.ReadKey();
Console.Write("Will Donald drink a slow potion?: ");
Donald.Potion = Convert.ToString(Console.Read());
Console.ReadKey();
TakeDamage();
SlowDown();
PrintStats();
}
static void TakeDamage()
{
if (Donald.Food == "Turkey")
{
Donald.Health -= 15;
}
if (Donald.Food == "Steak")
{
Donald.Health += 15;
}
}
static void SlowDown()
{
if (Donald.Potion == "Yes")
{
Donald.Speed -= 50;
}
}
static void PrintStats()
{
Console.WriteLine(Donald.Speed);
Console.WriteLine(Donald.Potion);
Console.WriteLine(Donald.Health);
Console.WriteLine(Donald.Food);
Console.WriteLine(Donald.Damage);
}
}
}