Simplify Love (C#) folder structure

This commit is contained in:
Zev Spitz
2022-01-17 11:12:56 +02:00
parent 3eed84264f
commit df8269fd0c
7 changed files with 11 additions and 20 deletions

26
58_Love/csharp/Input.cs Normal file
View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
namespace Love
{
// Provides input methods which emulate the BASIC interpreter's keyboard input routines
internal static class Input
{
private static void Prompt(string text = "") => Console.Write($"{text}? ");
public static string ReadLine(string prompt)
{
Prompt(prompt);
var values = ReadStrings();
if (values.Length > 1)
{
Console.WriteLine("!Extra input ingored");
}
return values[0];
}
private static string[] ReadStrings() => Console.ReadLine().Split(',', StringSplitOptions.TrimEntries);
}
}