From eadfc8a30364f16414d6663c1843dc31f2c06374 Mon Sep 17 00:00:00 2001 From: Rafly Nagachi <45258358+raflynagachi@users.noreply.github.com> Date: Mon, 4 Oct 2021 19:57:53 +0700 Subject: [PATCH 1/3] Translate text to morse --- C++/Morse.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 C++/Morse.cpp diff --git a/C++/Morse.cpp b/C++/Morse.cpp new file mode 100644 index 00000000..c6112c42 --- /dev/null +++ b/C++/Morse.cpp @@ -0,0 +1,33 @@ +#include +using namespace std; + +char alphabet [] = {'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',' '}; +string MorseAlphabet[] = {".-", "-...", "-.-.", "-..", ".", + "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", + "---", ".--.", "--.-", ".-.", "...", "-", + "..-", "...-", ".--", "-..-", "-.--", + "--.."}; +char Alphabet[] = {'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', ' '}; + +void translate(string *nama, int n){ + for(int i=0;i>n; + string nama[n];cin.ignore(); + for(int i=0;i Date: Mon, 4 Oct 2021 20:25:31 +0700 Subject: [PATCH 2/3] Translate text to morse --- Morse.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Morse.cpp diff --git a/Morse.cpp b/Morse.cpp new file mode 100644 index 00000000..c6112c42 --- /dev/null +++ b/Morse.cpp @@ -0,0 +1,33 @@ +#include +using namespace std; + +char alphabet [] = {'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',' '}; +string MorseAlphabet[] = {".-", "-...", "-.-.", "-..", ".", + "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", + "---", ".--.", "--.-", ".-.", "...", "-", + "..-", "...-", ".--", "-..-", "-.--", + "--.."}; +char Alphabet[] = {'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', ' '}; + +void translate(string *nama, int n){ + for(int i=0;i>n; + string nama[n];cin.ignore(); + for(int i=0;i Date: Mon, 4 Oct 2021 20:26:30 +0700 Subject: [PATCH 3/3] Delete Morse.cpp --- Morse.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 Morse.cpp diff --git a/Morse.cpp b/Morse.cpp deleted file mode 100644 index c6112c42..00000000 --- a/Morse.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -using namespace std; - -char alphabet [] = {'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',' '}; -string MorseAlphabet[] = {".-", "-...", "-.-.", "-..", ".", - "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", - "---", ".--.", "--.-", ".-.", "...", "-", - "..-", "...-", ".--", "-..-", "-.--", - "--.."}; -char Alphabet[] = {'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', ' '}; - -void translate(string *nama, int n){ - for(int i=0;i>n; - string nama[n];cin.ignore(); - for(int i=0;i