Пример #1
0
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'))
Пример #2
0
 def readMove(self):
     """
     read and return a move to pass to a board
     """
     k = keypress.getArrowKey()
     return Game.__dirs.get(k)