mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
Simplify Tower (C#) folder structure
This commit is contained in:
27
90_Tower/csharp/Program.cs
Normal file
27
90_Tower/csharp/Program.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Tower.Resources;
|
||||
using Tower.UI;
|
||||
|
||||
namespace Tower
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.Write(Strings.Title);
|
||||
|
||||
do
|
||||
{
|
||||
Console.Write(Strings.Intro);
|
||||
|
||||
if (!Input.TryReadNumber(Prompt.DiskCount, out var diskCount)) { return; }
|
||||
|
||||
var game = new Game(diskCount);
|
||||
|
||||
if (!game.Play()) { return; }
|
||||
} while (Input.ReadYesNo(Strings.PlayAgainPrompt, Strings.YesNoPrompt));
|
||||
|
||||
Console.Write(Strings.Thanks);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user