mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Simplify Target (C#) folder strucure
This commit is contained in:
39
86_Target/csharp/Program.cs
Normal file
39
86_Target/csharp/Program.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Target
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
DisplayTitleAndInstructions();
|
||||
|
||||
var firingRange = new FiringRange();
|
||||
|
||||
while (true)
|
||||
{
|
||||
Game.Play(firingRange);
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Next target...");
|
||||
Console.WriteLine();
|
||||
|
||||
firingRange.NextTarget();
|
||||
}
|
||||
}
|
||||
|
||||
private static void DisplayTitleAndInstructions()
|
||||
{
|
||||
using var stream = Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceStream("Target.Strings.TitleAndInstructions.txt");
|
||||
using var stdout = Console.OpenStandardOutput();
|
||||
|
||||
stream.CopyTo(stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user