initial commit

This commit is contained in:
Edward Tirado Jr 2025-11-05 10:38:32 -06:00
commit 65c137cec1
32 changed files with 420 additions and 0 deletions

35
MadLib/Program.cs Normal file
View file

@ -0,0 +1,35 @@
namespace MadLib;
public class Program
{
public static void Main(string[] args)
{
var category = GetChoice();
var storyGenerator = new StoryGenerator(category);
storyGenerator.Generate();
}
private static StoryGenerator.Categories GetChoice()
{
while (true)
{
Console.WriteLine("Choose a category:");
StoryGenerator.DisplayCategories();
var choice = Console.ReadLine();
if (string.IsNullOrWhiteSpace(choice))
{
Console.WriteLine("Invalid input.");
continue;
}
var selectedCategory = int.Parse(choice.Trim()) - 1;
if (Enum.IsDefined(typeof(StoryGenerator.Categories), selectedCategory))
return (StoryGenerator.Categories)selectedCategory;
Console.WriteLine("Please enter a valid category.");
}
}
}