Esempio n. 1
0
        public void Run()
        {
            Console.WriteLine("Choose file:"); // Prompt
            Console.WriteLine("1 - abra.txt"); // Prompt
            Console.WriteLine("2 - pi.txt"); // Prompt
            Console.WriteLine("or quit"); // Prompt

            var fileNumber = Console.ReadLine();
            var alpha = string.Empty;
            var fieName = string.Empty;
            switch (fileNumber)
            {
                case "1":
                    fieName = "abra.txt";
                    alpha = "ABCDR";
                    break;
                case "2":
                    fieName = "pi.txt";
                    alpha = "0123456789";
                    break;
                case "quit":
                    return;
                default:
                    return;
            }

            var @in = new In($"Files\\Strings\\{fieName}");
            var content = @in.ReadAll();

            var count = new Count(alpha);
            count.Run(content);

            Console.ReadLine();
        }
Esempio n. 2
0
        public void Run()
        {
            Console.WriteLine("Choose file:"); // Prompt
            Console.WriteLine("1 - abra.txt"); // Prompt
            Console.WriteLine("or quit"); // Prompt

            var fileNumber = Console.ReadLine();
            var fieName = string.Empty;
            switch (fileNumber)
            {
                case "1":
                    fieName = "abra.txt";
                    break;
                case "quit":
                    return;
                default:
                    return;
            }

            var @in = new In($"Files\\Strings\\{fieName}");
            var content = @in.ReadAll();
            var binaryDump = new BinaryDump(content, 16);
            binaryDump.Dump();

            Console.ReadLine();
        }
Esempio n. 3
0
        public void Run()
        {
            Console.WriteLine("Choose file:"); // Prompt
            Console.WriteLine("1 - genomeTiny.txt"); // Prompt
            Console.WriteLine("2 - genomeVirus.txt"); // Prompt
            Console.WriteLine("or quit"); // Prompt

            var fileNumber = Console.ReadLine();
            var fieName = string.Empty;
            switch (fileNumber)
            {
                case "1":
                    fieName = "genomeTiny.txt";
                    break;
                case "2":
                    fieName = "genomeVirus.txt";
                    break;
                case "quit":
                    return;
                default:
                    return;
            }

            var @in = new In($"Files\\Strings\\{fieName}");
            var content = @in.ReadAll();
            var genome = new Genome();
            genome.Compress(content);

            var list = new List<byte>();
            var bytes = genome.ToByteList(list, content);
            genome.Expand(bytes.ToArray());

            Console.ReadLine();
        }