using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Level3 { class Program { static void Main(string[] args) { string text = @"qmnjvsa nv wewc flct vprj tj tvvplvl fv xja vqildhc xmlnvc nacyclpa fc gyt vfvw. fv wgqyp, pqq pqcs y wsq rx qmnjvafy cgv tlvhf cw tyl aeuq fv xja tkbv cqnsqs. lhf avawnc cv eas fuqb qvq tc yllrqr xxwa cfy. psdc uqf avrqc gefq pyat trac xwv taa wwd dv eas flcbq. vd trawm vupq quw x decgqcwt, yq yafl vlqs yqklhq! snafq vml lhvqpawr nqg_vfusr_ec_wawy qp fn wgawdgf."; // Permute, order 43512 string permutedText = ""; int charAt = 0; try { while (true) { char[] chars = new char[5]; string[] interstitials = new string[5]; for (int curIndex = 0; curIndex < 5; curIndex++) { if (Char.IsLetter(text[charAt])) { chars[curIndex] = text[charAt++]; // Take all the non-letters with it too while (!Char.IsLetter(text[charAt])) interstitials[curIndex] += text[charAt++]; } } // Now concatenate permutedText += chars[3] + interstitials[0] + chars[2] + interstitials[1] + chars[4] + interstitials[2] + chars[0] + interstitials[3] + chars[1] + interstitials[4]; } } catch (Exception) { } text = permutedText; string[] rules = { "Ow", "Aq", "Ta", "Sl", "Ph", "Ev", "Hf", "Gg", "dd", "Rn", "Km", "Wr", "Dp", "Ic", "yy", "jj", "Fs", "Ce", "tt", "xx", "ii", "uu", "kk", "bb", }; foreach (string i in rules) { Console.WriteLine("***" + i[1]); text = text.Replace("" + i[1], "" + i[0]); } // Print int pos = 0; foreach (char c in text) { if (!Char.IsLetter(c)) { Console.Write(c); continue; } Console.Write(c); pos++; if (pos == 5) { pos = 0; //Console.Write("|"); } } } } }