Skip to content

Instantly share code, notes, and snippets.

@errorseven
Created April 25, 2017 21:11
Show Gist options
  • Save errorseven/50ed8e2b3bad7fbe13188f4a6c0b829d to your computer and use it in GitHub Desktop.
Save errorseven/50ed8e2b3bad7fbe13188f4a6c0b829d to your computer and use it in GitHub Desktop.
Reddit/r/dailyprogrammer - [2017-04-24] Challenge #312 [Easy] L33tspeak Translator
Chalinput :=
(
"I am elite.
Da pain!
Eye need help!
3Y3 (\)33d j00 t0 g37 d4 d0c70r.
1 n33d m4 p1llz!"
)
for e, line in StrSplit(Chalinput, "`n", "`r")
r .= line " -> " (line ~= "[37(4)016\/]" ? l33t(line, 1)
: l33t(line)) "`n"
msgbox % clipboard := r
l33t(line, y:=0) {
leet := { A: "4", B: "6", E: "3", I: "1", L: "1", M: "(V)"
, N: "(\)", O: "0", S: "5", T: "7", V: "\/", W: "``//"}
for key, char in leet
line := Format("{:L}", StrReplace(line, (y ? char : key)
, (y ? key : char)))
return line
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment