Is the import of `moves` really necessary? You're only using `xrange` from that package, and you're only ever using `xrange(4)`. You can safely avoid the import and use `range()`: I'm sure the tests can bear the 4-element list you'll construct on Python 2. ;)