From c282bfb37a03fda983b584065de1678910941c1e Mon Sep 17 00:00:00 2001 From: Pedro Artur Silva Costa <166542074+GravityProtogen@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:42:59 -0300 Subject: [PATCH] Added Punctuation --- .../rocks/poopjournal/morse/MainActivity.java | 74 ++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java index d0cbfbb..3aa67ba 100644 --- a/app/src/main/java/rocks/poopjournal/morse/MainActivity.java +++ b/app/src/main/java/rocks/poopjournal/morse/MainActivity.java @@ -333,6 +333,42 @@ static String morseEncode(String x) { return ".-.-"; case "ñ": return "--.--"; + case ",": + return "--..--"; + case ".": + return ".-.-.-"; + case "?": + return "..--.."; + case "'": + return ".----."; + case "!": + return "-.-.--"; + case "/": + return "-..-."; + case "(": + return "-.--."; + case ")": + return "-.--.-"; + case "&": + return ".-..."; + case ":": + return "---..."; + case ";": + return "-.-.-."; + case "=": + return "-...-"; + case "+": + return ".-.-."; + case "-": + return "-....-"; + case "_": + return "..--.-"; + case '"': + return ".-..-."; + case "$": + return "...-..-"; + case "@": + return ".--.-."; default: return ""; } @@ -420,8 +456,44 @@ static String morseDecode(String morse) { return "9"; case "--.--": return "ñ"; + case "--..--": + return ","; + case ".-.-.-": + return "."; + case "..--..": + return "?"; + case ".----.": + return "'"; + case "-.-.--": + return "!"; + case "-..-.": + return "/"; + case "-.--.": + return "("; + case "-.--.-": + return ")"; + case ".-...": + return "&"; + case "---...": + return ":"; + case "-.-.-.": + return ";"; + case "-...-": + return "="; + case ".-.-.": + return "+"; + case "-....-": + return "-"; + case "..--.-": + return "_"; + case ".-..-.": + return '"'; + case "...-..-": + return "$"; + case ".--.-.": + return "@"; } - + return ""; }