mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-05 09:39:32 -08:00
Simplify Mugwump (C#) folder structure
This commit is contained in:
33
62_Mugwump/csharp/Program.cs
Normal file
33
62_Mugwump/csharp/Program.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Mugwump
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
DisplayIntro();
|
||||
|
||||
var random = new Random();
|
||||
|
||||
while (true)
|
||||
{
|
||||
Game.Play(random);
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("That was fun! Let's play again.......");
|
||||
Console.WriteLine("Four more mugwumps are now in hiding.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DisplayIntro()
|
||||
{
|
||||
using var stream = Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceStream("Mugwump.Strings.Intro.txt");
|
||||
using var stdout = Console.OpenStandardOutput();
|
||||
|
||||
stream.CopyTo(stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user