def operation(): op = keypress.getArrowKey() directions = {65:'up', 66:'down', 67:'right', 68:'left', 81:'quit', 113:'quit'} moveCells(direction=directions.get(op, 'wrong direction'))
def readMove(self): """ read and return a move to pass to a board """ k = keypress.getArrowKey() return Game.__dirs.get(k)