Ravage Yeah knowing that earlier would have made my life a lot easier.
At least I was on the right track, mine used ASCII character codes to make the conversion. Though it doesn't really matter if you can use bitwise gates to do it. Would never have thought of that.
function m(s){s=s.replace(/\s+/g,' ').trim();var q="";for(var i=0;i<s.length;i++){var c=s[i];var d="/ ----- .---- ..--- ...-- ....- ..... -.... --... ---.. ----. .- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..".split(" ");var x=c.charCodeAt(0)-32;q+=d[x];}return q;} // 349 :(
Also (and this could just be me) @Varrience's code crashes when I try to use it, says it can't wrap the value undefined.