Skip to content

Commit

Permalink
Added Punctuation
Browse files Browse the repository at this point in the history
GravityProtogen authored Oct 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4f6dfd9 commit c282bfb
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion app/src/main/java/rocks/poopjournal/morse/MainActivity.java
Original file line number Diff line number Diff line change
@@ -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 "";
}

0 comments on commit c282bfb

Please sign in to comment.