public static string Titaah_decode(string sentence) { string sequences = ""; // Ne rien modifier au dessus de ce commentaire string tmp1 = ""; sentence = sentence.Replace("ti", ". "); sentence = sentence.Replace("Ti", ". "); sentence = sentence.Replace("taah", "_ "); sentence = sentence.Replace("Taah", "_ "); sentence = sentence.Replace("!", "_ _ _ ."); sentence = sentence.Replace(",", " / "); sentence = sentence.Replace(" / ", " / "); sentence = sentence.Replace(" .", " ."); sentence = sentence.Replace(" _", " _"); tmp1 = TD4.Morse_decode(sentence); // Je voulais boucler pour catcher n'importe quel autre Maj Char mais manque de temps tmp1 = tmp1.Replace("W", "w"); sequences = tmp1; // Ne rien modifier au dessous de ce commentaire return(sequences); }
public static void Main(string[] args) { TD4 tD4 = new TD4(); TD4.Test(); TD5 tD5 = new TD5(); TD5.Test(); }
public static void Main(string[] args) { TD1 tD1 = new TD1(); //TD1.Test(); TD2 tD2 = new TD2(); //TD2.Test(); TD4 td4 = new TD4(); TD4.Test(); }
public static string Titaah_decode(string sentence) { string sequences = ""; // Ne rien modifier au dessus de ce commentaire sentence = sentence.Replace("ti", ". "); sentence = sentence.Replace("Ti", ". "); sentence = sentence.Replace("taah", "_ "); sentence = sentence.Replace("Taah", "_ "); sentence = sentence.Replace("!", "_ _ _ ."); sentence = sentence.Replace(",", " / "); sentence = sentence.Replace(" / ", " / "); sentence = sentence.Replace(" .", " ."); sentence = sentence.Replace(" _", " _"); sequences = TD4.Morse_decode(sentence); // Ne rien modifier au dessous de ce commentaire return(sequences); }
public static string Titaah_encode(string sentence) { string sequences = ""; // Ne rien modifier au dessus de ce commentaire char[] letters_sentence = sentence.ToCharArray(); char[] letters = { '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', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.', ',', ':', '?', '!', '\\', '/', '"', '@', '=' }; //string[] morseLetters = { "ti", "taahtititi", "tahtitahti", "tahtiti", "ti", "tititahti", "tahtahti", "titititi", "titi", "titahtahtah", "tahtitah", "titahtiti", "tahtah", "tahti", "tahtahtah", "titahtahti", "tahtahtitah", "titahti", "tititi", "tah", "tititah", "titititah", "titahtah", "tahtititah", "tahtitahtah", "tahtahtiti", "titahtahtahtah", "tititahtahtah", "titititahtah", "tititititah", "tititititi", "tahtitititi", "tahtahtititi", "tahtahtahtiti", "tahtahtahtahti", "titahtahtahtahtahtahtahtahtah", ". _ . _ . _", "_ _ . . _ _", "_ _ _ . . .", ". . _ _ . .", "_ _ _ .", ". _ _ _ _ .", "_ . . . . _", "_ . . _ .", ". _ . . _ .", ". _ _ . _ .", "_ . . . _" }; string[] morseLetters = { " / ", ". _", "_ . . .", "_ . _ .", "_ . .", ".", ". . _ .", "_ _ .", ". . . .", ". .", ". _ _ _ ", "_ . _", ". _ . .", "_ _", "_ .", "_ _ _", ". _ _ .", "_ _ . _", ". _ .", ". . .", "_", ". . _", ". . . _", ". _ _", "_ . . _", "_ . _ _", "_ _ . .", ". _ _ _ _", ". . _ _ _", ". . . _ _", ". . . . _", ". . . . .", "_ . . . .", "_ _ . . .", "_ _ _ . .", "_ _ _ _ .", ". _ _ _ _ _ _ _ _ _", ". _ . _ . _", "_ _ . . _ _", "_ _ _ . . .", ". . _ _ . .", "_ _ _ .", ". _ _ _ _ .", "_ . . . . _", "_ . . _ .", ". _ . . _ .", ". _ _ . _ .", "_ . . . _" }; string morse = TD4.Morse_encode(sentence.ToLower()); morse = morse.Replace(". ", "ti"); morse = morse.Replace("_ ", "taah"); morse = morse.Replace("/", ","); morse = morse.Replace("taahtaahtaah.", "!"); morse = morse.Replace(" ", " "); int count = 0; string tmp = ""; foreach (char letter in morse) { tmp = letter.ToString(); if (count == 0) { tmp = tmp.ToUpper(); } count++; sequences += tmp; } // Ne rien modifier au dessous de ce commentaire return(sequences); }