' '(playerx playery ) ' '(playerx playery ) ' '(playerx playery ) ' '(playerx playery ) ' '(playerx playery ) ' '(playerx playery ) ' '(playerx playery ) ' '(playerxplayery)}[move def moverobots(boardrobotpositionsplayerposition) """return list of (xytuples of new robot positions after they have tried to move toward the player "" playerxplayery playerposition nextrobotpositions [ while len(robotpositions robotxroboty robotpositions[ determine the direction the robot moves if robotx playerx movex move right elif robotx playerx movex - move left elif robotx =playerx movex don' move horizontally if roboty playery movey move up elif roboty playery movey - move down elif roboty =playery movey don' move vertically check if the robot would run into walland adjust course if board[(robotx movexroboty movey)=wall robot would run into wallso come up with new move if board[(robotx movexroboty)=empty_space movey robot can' move horizontally elif board[(robotxroboty movey)=empty_space movex robot can' move vertically else robot can' move movex movey newrobotx robotx movex newroboty roboty movey if (board[(robotxroboty)=dead_robot or board[(newrobotxnewroboty)=dead_robot) robot is at crash siteremove it del robotpositions[ continue check if it moves into robotthen destroy both robots project #