def result(self,state,a): [loc,dir]=a if state.player==SELF_PLAYER: tmpPlayer=ENEMS_PLAYER else: tmpPlayer=SELF_PLAYER cMap=self.getClearMap(state,tmpPlayer) for (r,c) in loc: cMap[r][c]=tmpPlayer s=GameState(cMap, tmpPlayer) s.dirs=dir s.loc=loc self.saveSumDistance(s) listKill=self.preKill(s) for (r,c,p) in listKill: s.map[r][c]=LAND s.reward=(len(self.getAnts(s,SELF_PLAYER)),len(self.getAnts(s, ENEMS_PLAYER))) return s