from synchrod import * def input_action(): interactive_actions = {3:GO_UP, 1:GO_RIGHT, 4:GO_DOWN, 2:GO_LEFT, 6:ATTACK, 9:QUIT} i = -1 while not i in interactive_actions.keys(): i = wait_key() return interactive_actions.get(i) demander_action = input_action