add 00_Alternate_Langage folder and move alternate ports there

This commit is contained in:
Jeff Atwood
2022-03-15 20:49:07 -07:00
parent a0931700e9
commit 43f2ec013a
1789 changed files with 85900 additions and 446 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Reflection;
using Games.Common.IO;
using Games.Common.Randomness;
namespace Target
{
class Program
{
static void Main()
{
var io = new ConsoleIO();
var game = new Game(io, new FiringRange(new RandomNumberGenerator()));
Play(game, io, () => true);
}
public static void Play(Game game, TextIO io, Func<bool> playAgain)
{
DisplayTitleAndInstructions(io);
while (playAgain())
{
game.Play();
io.WriteLine();
io.WriteLine();
io.WriteLine();
io.WriteLine();
io.WriteLine();
io.WriteLine("Next target...");
io.WriteLine();
}
}
private static void DisplayTitleAndInstructions(TextIO io)
{
using var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream("Target.Strings.TitleAndInstructions.txt");
io.Write(stream);
}
}
}