Skip to content

Instantly share code, notes, and snippets.

@stevehjohn
Last active July 6, 2018 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevehjohn/af7adef34921f798a878527a4b9d80f5 to your computer and use it in GitHub Desktop.
Save stevehjohn/af7adef34921f798a878527a4b9d80f5 to your computer and use it in GitHub Desktop.
var lines = new[]
{
" _ _ _ _ _ _ _ _ ",
"| | | _| _||_||_ |_ ||_||_|",
"|_| ||_ _| | _||_| ||_| _|"
};
//var lines = new[]
//{
// " _ _ _ _ _ _ _ ",
// "|_||_|| ||_||_ | | ||_ ",
// " | _||_||_||_| | | | _|"
//};
var patterns = new[]
{
" _ | ||_|",
" | |",
" _ _||_ ",
" _ _| _|",
" |_| |",
" _ |_ _|",
" _ |_ |_|",
" _ | |",
" _ |_||_|",
" _ |_| _|"
};
for (var i = 0; i < lines[0].Length; i += 3)
{
var chars = new char[9];
for (var y = 0; y < 3; y++)
{
for (var x = 0; x < 3; x++)
{
chars[x + y * 3] = lines[y][x + i];
}
}
var str = new string(chars);
for (var c = 0; c < 10; c++)
{
if (patterns[c] == str)
{
Console.Write(c);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment