c-sharp-i-am-trying-to-make-simple-encryptor

CSharp · Console

/Program.cs

using System;
using System.Text;

/*
* This was taken from a since deleted stackoverflow question
* it looked interesting at the time so it was something I wanted to play with.
*/
public class Program
{
	public static void Main()
	{
	  string[] Alpha = new string[]
        {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
        string[][] Encryptor = new string[][]
        {
          new string[] {"4", "/=", "@", "/-"},
          new string[] {"8", "13", "|3", "&" },
          new string[] {"(", "¢", "<", "[", },
          new string[] {"[)", "|>", "|)", "|]"},
          new string[] {"3", "€", "[-", "[=" },
          new string[] {"|=", "ƒ", "/="},
          new string[] {"6", "(_+"},
          new string[] {"#", "/-/", "[-]", "]-[", ")-(", "(-)"},
          new string[] {"1", "!", "|", "][", ":"},
          new string[] {"_|", "_/"},
          new string[] {"|<", "|{"},
          new string[] {"1_", "|_", "[_"},
          new string[] {"|V|", "|V/|"},
          new string[] {"|V", "/v"},
          new string[] {"[]", "0", "()"},
          new string[] {"|*", "|0", "|o" },
          new string[] {"(_,)", "()_", "0_", "O_"},
          new string[] {"2", "|?", "|2"},
          new string[] {"5", "$", "_/~" },
          new string[] {"7", "¯|¯" },
          new string[] {"(_)", "!_!", "|_|"},
          new string[] {"|/", "!/"},
          new string[] {"`//", "\v/", "|_|_/"},
          new string[] {"><", "}{", ")("},
          new string[] {"`/", "!/"},
          new string[] {"≥", "7_", ">_"}
        };
		Random rand = new Random();
		string str = Console.ReadLine();
		
		StringBuilder rez = new StringBuilder();
		for (int i = 0; i < str.Length; i++)
		{
			int index = Array.IndexOf(Alpha, str[i].ToString());
			string[] curEnc = Encryptor[index];
			int r = rand.Next(curEnc.Length-1);
			rez.Append(curEnc[r]);
		}

		Console.WriteLine(rez.ToString());
	} 
}
;