Created
January 22, 2015 22:23
-
-
Save mootrichard/7608479e2855875d6d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Phase 1 | |
var decryptA = function(message){ | |
var temp = message.split(" "), | |
i = 0, | |
result = []; | |
for(i = 0;i < temp.length;i++){ | |
result.push(temp[i].slice(temp[i].length - 1)) | |
} | |
result = result.join(""); | |
return result; | |
}; | |
// Phase 2 | |
var decryptB = function (message){ | |
var temp = message.split(" "), | |
i = 0, | |
result = []; | |
for(i = 0;i < temp.length;i++){ | |
if (temp[i].slice(0,1) > temp[i].slice(temp[i].length - 1)){ | |
result.push(temp[i].slice(0,1)); | |
} | |
else{ | |
result.push(temp[i].slice(temp[i].length - 1)); | |
} | |
} | |
result = result.join(""); | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment