static void Str_matr_decrypt() { Morse_matrix code_tbl = new Morse_matrix(); code_tbl.Write_matrix(); Console.WriteLine("From beep to sos"); string[] sos = { "... ", "--- ", "... " }; string word = code_tbl.Decrypt(sos); Console.WriteLine("sos decrypt :" + word); }
static void Str_matr_crypt_key() { Console.WriteLine("Beep sos"); string word = "sos"; Console.WriteLine("Please, write key from 1 to 35 :"); int b = int.Parse(Console.ReadLine()); Morse_matrix code_tbl = new Morse_matrix(Alphabet.Dictionary_arr, b); code_tbl.Write_matrix(); string rslt = code_tbl.Crypt(word); Console.WriteLine("sos : " + rslt); code_tbl.Res_beep(rslt); Console.WriteLine("From beep to sos"); string[] sos = { rslt.Substring(0, 5), rslt.Substring(5, 5), rslt.Substring(10, 5) }; word = code_tbl.Decrypt(sos); Console.WriteLine("sos decrypt :" + word); }