Made CorgiCoder's Shift Cipher even more awesome!
This commit is contained in:
parent
2dad5db062
commit
85da23a688
Binary file not shown.
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace CorgiCoder.ShiftCipher;
|
|
||||||
|
|
||||||
public class ShiftSerializer
|
|
||||||
{
|
|
||||||
static ShiftSerializer()
|
|
||||||
{
|
|
||||||
Console.WriteLine("Loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShiftSerializer()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
306
ShiftCipher/ShiftSerializer.cs
Normal file
306
ShiftCipher/ShiftSerializer.cs
Normal file
@ -0,0 +1,306 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
namespace CorgiCoder.ShiftCipher;
|
||||||
|
|
||||||
|
public class ShiftSerializer
|
||||||
|
{
|
||||||
|
public ShiftSerializerOptions Options { get; private init; }
|
||||||
|
|
||||||
|
static ShiftSerializer()
|
||||||
|
{
|
||||||
|
// Print the logo! That's the most important part.
|
||||||
|
// This is the best way I, CorgiCoder, can think of to do this.
|
||||||
|
string[] textElements1 = new string[]
|
||||||
|
{
|
||||||
|
"""
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██ ████
|
||||||
|
████
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██
|
||||||
|
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
████████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
████████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
████████
|
||||||
|
██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██ ████
|
||||||
|
████
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██
|
||||||
|
██████
|
||||||
|
██
|
||||||
|
██████
|
||||||
|
"""
|
||||||
|
};
|
||||||
|
string[] textElements2 = new string[]
|
||||||
|
{
|
||||||
|
"""
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██ ████
|
||||||
|
████
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██
|
||||||
|
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
████████
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
██ ██
|
||||||
|
████████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██ ██
|
||||||
|
████████
|
||||||
|
██
|
||||||
|
██████
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██ ████
|
||||||
|
████
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
██
|
||||||
|
██
|
||||||
|
██
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
██████
|
||||||
|
██
|
||||||
|
██████
|
||||||
|
██
|
||||||
|
██████
|
||||||
|
"""
|
||||||
|
};
|
||||||
|
ConsoleColor[] colors = { ConsoleColor.Red, ConsoleColor.DarkYellow, ConsoleColor.Yellow,
|
||||||
|
ConsoleColor.DarkGreen, ConsoleColor.Green, ConsoleColor.Cyan,
|
||||||
|
ConsoleColor.DarkCyan, ConsoleColor.Blue, ConsoleColor.DarkBlue,
|
||||||
|
ConsoleColor.Magenta, ConsoleColor.DarkMagenta, ConsoleColor.DarkRed };
|
||||||
|
|
||||||
|
// Stay tuned on CorgiCoder's Shift Cipher!
|
||||||
|
int position = 0;
|
||||||
|
for (int i = 0; i < textElements1.Length; i++)
|
||||||
|
{
|
||||||
|
int maxLength = 0;
|
||||||
|
string[] lines = textElements1[i].Split('\n');
|
||||||
|
Console.ForegroundColor = colors[i % colors.Length];
|
||||||
|
for (int j = 0; j < lines.Length; j++)
|
||||||
|
{
|
||||||
|
Console.SetCursorPosition(position, j);
|
||||||
|
Console.WriteLine(lines[j]);
|
||||||
|
if (maxLength < lines[j].Length) maxLength = lines[j].Length;
|
||||||
|
}
|
||||||
|
if (i < textElements1.Length - 1) position += maxLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
position = 0;
|
||||||
|
for (int i = 0; i < textElements1.Length; i++)
|
||||||
|
{
|
||||||
|
int maxLength = 0;
|
||||||
|
string[] lines = textElements1[i].Split('\n');
|
||||||
|
|
||||||
|
Console.ForegroundColor = colors[i % colors.Length];
|
||||||
|
for (int j = 0; j < lines.Length; j++)
|
||||||
|
{
|
||||||
|
Console.SetCursorPosition(position, j + textElements1.Length + 1);
|
||||||
|
Console.WriteLine(lines[j]);
|
||||||
|
if (maxLength < lines[j].Length) maxLength = lines[j].Length;
|
||||||
|
}
|
||||||
|
if (i < textElements1.Length - 1) position += maxLength;
|
||||||
|
}
|
||||||
|
Console.ResetColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ShiftSerializer(ShiftSerializerOptions options)
|
||||||
|
{
|
||||||
|
Options = options;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ShiftSerializer Create(ShiftSerializerOptions options) => new(options);
|
||||||
|
public static ShiftSerializer CreateDefault() => new(new());
|
||||||
|
}
|
||||||
13
ShiftCipher/ShiftSerializerOptions.cs
Normal file
13
ShiftCipher/ShiftSerializerOptions.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace CorgiCoder.ShiftCipher;
|
||||||
|
|
||||||
|
public record class ShiftSerializerOptions
|
||||||
|
{
|
||||||
|
public static readonly ShiftSerializerOptions Default = new();
|
||||||
|
|
||||||
|
public int offsetCount;
|
||||||
|
|
||||||
|
public ShiftSerializerOptions()
|
||||||
|
{
|
||||||
|
offsetCount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,6 @@ public static class Program
|
|||||||
{
|
{
|
||||||
public static void Main()
|
public static void Main()
|
||||||
{
|
{
|
||||||
ShiftSerializer shift = new();
|
ShiftSerializer shift = ShiftSerializer.CreateDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user