Skip to content

Commit

Permalink
Added Punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
GravityProtogen authored Oct 28, 2024
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
Expand Up @@ -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 "";
}
Expand Down Expand Up @@ -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 "";
}

Expand Down

0 comments on commit c282bfb

Please sign in to comment.