Fixes and Design Improvements
This commit is contained in:
parent
945b5838e1
commit
4d6006e99b
6 changed files with 55 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
|||
function encodeWrittenMorseManager(inputMessage) {
|
||||
function decryptWrittenMorseManager(inputMessage) {
|
||||
if(inputMessage === ""){
|
||||
return "Please enter at least one character";
|
||||
} else {
|
||||
|
@ -6,7 +6,13 @@ function encodeWrittenMorseManager(inputMessage) {
|
|||
inputMessage = inputMessage.substring(0, message.length() - 1);
|
||||
}
|
||||
// Variables
|
||||
var input = inputMessage.toUpperCase() + "#";
|
||||
var input = inputMessage.toUpperCase();
|
||||
if(input.endsWith('#') == false){
|
||||
input = input + "#";
|
||||
}
|
||||
while(input.indexOf('\n') != -1){
|
||||
input = input.replace("\n","")
|
||||
}
|
||||
var inputToSign = input;
|
||||
var output = "";
|
||||
var d = 0;
|
|
@ -1,4 +1,4 @@
|
|||
function decodeWrittenMorseManager(message) {
|
||||
function encryptWrittenMorseManager(message) {
|
||||
if(message == ""){
|
||||
return "Please enter at least one character"
|
||||
} else {
|
||||
|
@ -7,6 +7,9 @@ function decodeWrittenMorseManager(message) {
|
|||
}
|
||||
// Variables
|
||||
var input = message.toUpperCase()
|
||||
while(input.indexOf('\n') != -1){
|
||||
input = input.replace("\n","")
|
||||
}
|
||||
var output = ""
|
||||
if (input == "LETTERSPACE") {
|
||||
output = "#"
|
Reference in a new issue