mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-04 17:17:59 -08:00
Add game logic and fix resources
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using Tower.Resources;
|
||||
using Tower.UI;
|
||||
|
||||
namespace Tower
|
||||
{
|
||||
@@ -6,7 +8,20 @@ namespace Tower
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
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