Initial commit — Wordle/letter word solver and scorer
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static string Canonicalize(this string s)
|
||||
{
|
||||
return s.ToUpperInvariant();
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetFileLines(this string filename)
|
||||
{
|
||||
using (var sr = File.OpenText(filename))
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var line = sr.ReadLine();
|
||||
if (line == null)
|
||||
yield break;
|
||||
yield return line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user