Easily Typeable Words This competition is over.

The winner is CJam with 22 characters, beating TwiNight's answer by one character. Congratulations Dennis!

An honorable mention goes to Falko, who went totally crazy with the free imports.

.



A while ago I wanted to know how I can out-type modern smartphones with my Nokia 3310, and while some answers were really good, I still can't keep up! Maybe I should take a different approach and simply not write any words that are awkward to type.

We'll call a piece of text easily typeable if no two consecutive letters are on the same button on the telephone keyboard, given the standard layout:





Your task

Your task is to write a program/function that accepts a string s from stdin/as a parameter and returns a truthy value if s is easily typeable and a falsy value otherwise. The input will only consist of lowercase letters and spaces and is guaranteed to be non-empty!

Scoring

This is codegolf, so lowest character-count wins.

Import statements will not be counted towards your final score, so if you've ever wanted to use std::set_symmetric_difference, liftM4, or itertools.combinations in your code, now is the time!

-3 if your source code is easily typeable, assuming everything that's not a letter is on button 0. After all, I might want to message your code to some friends!

Testcases

Here are a few testcases to check if your code is working as intended:

"x" -&gt; True
"aardvark" -&gt; False
"ardvark" -&gt; True
"flonk" -&gt; False

"im codegolfing all day long" -&gt; False
"i indulge in minimizing bytecount" -&gt; True

"havent heard from you in a long time" -&gt; False
"your silence was of undue permanence" -&gt; True

"how are  you" -&gt; False
"how are you" -&gt; True


Happy golfing!
Python 2 - 80, 68, 64, 61, 58, 50, 48, 45, 44 42

Even though it's getting a little ridiculous now, I'll keep on making use of free library imports, even the __builtin__ library:

from numpy import diff as D
from pprint import pprint as P
from __builtin__ import all as A
from __builtin__ import raw_input as I
from __builtin__ import bytearray as B


So only the following short line counts towards the code length:

P(A(D([(o-o/112-o/59)/3for o in B(I())])))


Credits to Markuz for the ideas regarding input()! These free-import challenges always introduce you to some lesser known libraries. ;)



Alternative using only the operator library (98, 83 79):

from operator import ne as n
K=[(ord(c)-1-(c&gt;'p')-(c&gt;'w'))/3for c in input()]
print all(map(n,K[1:],K[:-1]))


I'll stop here. But you could further golf this version using sys, pprint and other libraries...



Alternative without libraries (105):

s=input()
n=lambda c:(ord(c)-1-(c&gt;'p')-(c&gt;'w'))/3
print all([n(s[i])!=n(s[i+1])for i in range(len(s)-1)])