Created
January 1, 2015 22:29
-
-
Save maxkrieger/0fc9f66eaa64b3205b70 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
// GL HF Translator (or gf hl or hg lf? :D) | |
function translate(str){ | |
var translation = ""; | |
for(var i=0; i<str.length; i++){ | |
switch(str.charAt(i)){ | |
case "g": | |
translation += "good "; | |
break; | |
case "l": | |
translation += "luck "; | |
break; | |
case "h": | |
translation += "have "; | |
break; | |
case "f": | |
translation += "fun "; | |
break; | |
} | |
} | |
return translation; | |
} | |
alert(translate(prompt("gl?"))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment