# A loose spellchecker

John Doe used to be one of the fastest QWERTY keyboard typists in the world, but a recent head injury caused by a stampeding herd of downgoats has critically hampered his ability to type accurately. In a desperate effort to retain his reputation as a typing prodigy, he has tasked us with the creation of a spellchecker - well, sort of. This spellchecker's rigged so that John Doe can worry less about accuracy and more about speed.

# Challenge

Here's the keyboard you'll be using. NOTE: non-spacebar keys are separated by 2 spaces, with the unshifted key followed by the shifted key.

zZ${m="xXcCvVbBnNmM,<"}.>/?, m+= // m = list of characters that are adjacent to space s=" " // add space to the list, s = space character ) |r // return r  ## Test var solution = (a,b)=>[...a].map((l,i)=>{p=k[g="indexOf"](l);q=k[g](o=b[i]);r=r?l==s|o==s?~m[g](l)&&~m[g](o):(x=(p%28/2|0)-(q%28/2|0))<2&x>-2&(y=(p/28|0)-(q/28|0))<2&y>-2:0},r=k=\~1!2@3#4$5%6^7&8*9(0)-_=+  \t qQwWeErRtTyYuUiIoOpP[{]}\\|  aAsSdDfFgGhHjJkKlL;:'"
zZ\${m="xXcCvVbBnNmM,<"}.>/?,m+=s=" ")|r
A = <input type="text" id="A" value="John Doe" /><br />
B = <input type="text" id="B" value="Jonh Deo" /><br />
<button onclick="result.textContent=solution(A.value,B.value)">Go</button>
<pre id="result"></pre>

• Wow, nice job! Although you might be able to save some bytes by lowercasing the input before mapping it (I think). Just a tip that might not work... – Mama Fun Roll Jan 18 '16 at 1:05
• @ՊՓԼՃՐՊՃՈԲՍԼ The problem is that my solution works by putting the characters in a 28x4 grid. If I don't include the upper-case letters I would need to pad it to 28 characters wide anyway. :( It might be possible to generate the upper-case letters in the grid though. I'll check how many bytes that takes... Nope, too many. – user81655 Jan 18 '16 at 1:07