1) not in visitedCoordinates and ( robot.GetLocation()[0], robot.GetLocation()[1] + 1) in traverse: robot.MoveNorth() elif p.plotDictionary[ (robot.GetLocation()[0], robot.GetLocation()[1] - 1)][0] != "#" and ( robot.GetLocation()[0], robot.GetLocation()[1] - 1) not in visitedCoordinates and ( robot.GetLocation()[0], robot.GetLocation()[1] - 1) in traverse: robot.MoveSouth() count += 1 visitedCoordinates.append(robot.GetLocation()) if robot.CheckForCrop(p.plotDictionary): #check for a crop p.RemoveCrop(robot.x, robot.y) found = True else: if algorithmChoice == 1: #if algorithm 1 just sit there and collect. If 5, follow the collection algorithm below. while count <= time: p.UpdatePlot() if robot.CheckForCrop(p.plotDictionary): p.RemoveCrop(robot.x, robot.y) count += 1 elif algorithmChoice == 5: #Ran out of time to fix. Only works if current location has all 8 surrounding tiles as plots and not walls iter = 0 while count <= time: p.UpdatePlot() if iter == 0: robot.MoveNorth()