using System.Collections.Generic;
public static void Main()
Console.WriteLine("Input DNA Genome");
string step1 = Console.ReadLine();
foreach (char base4i in step1) {
if (base4i.ToString().ToLower() == "a" || base4i.ToString().ToLower() == "t") {
Console.WriteLine("Finished decoding to binary: " + step2);
List<string> step3 = new List<string>();
step3 = step2.Split(' ').ToList<string>();
List<int> step4 = new List<int>();
step3.RemoveAt(step3.Count - 1);
Console.WriteLine("Decoding to numbers:");
foreach (string binaryi in step3) {
for (int c = 0; c < 8; c++) {
int ascii = binaryi[7 - c] - '0';
ascii = ascii * (int)Math.Pow(2, c);
catch (IndexOutOfRangeException e) {
Console.WriteLine("\n\nInvalid length of DNA code. Should be divisible by 8!");
Console.WriteLine("Please press \"run\" again.");
List<char> asciiTo = new List<char>{' ', '\n', ',', '.', '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', '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', ':', ';', '-'};
List<int> asciiFrom = new List<int>{32, 10, 44, 46, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 58, 59, 45};
foreach (int num in step4) {
if (asciiFrom.IndexOf(num) != -1) {
finished += asciiTo[asciiFrom.IndexOf(num)];
Console.WriteLine(finished);