mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
Simplify Love (C#) folder structure
This commit is contained in:
31
58_Love/csharp/Program.cs
Normal file
31
58_Love/csharp/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Love
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
DisplayIntro();
|
||||
|
||||
var message = Input.ReadLine("Your message, please");
|
||||
var pattern = new LovePattern();
|
||||
|
||||
var source = new SourceCharacters(pattern.LineLength, message);
|
||||
|
||||
using var destination = Console.OpenStandardOutput();
|
||||
|
||||
pattern.Write(source, destination);
|
||||
}
|
||||
|
||||
private static void DisplayIntro()
|
||||
{
|
||||
using var stream = Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceStream("Love.Strings.Intro.txt");
|
||||
using var stdout = Console.OpenStandardOutput();
|
||||
|
||||
stream.CopyTo(stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user