Python 3 implementation of 2048 game