mazeFinder.py
def result(self, node, action):
        '''
        Used to get the state after an action is used on a node
        returns the new state of the node
        '''
        state = node.state
        x = state[0]
        y = state[1]
        walls = state[2]
        if(action == "Move Up"):
            y -=BLOCKSIZE
        elif(action == "Move Down"):
            y +=BLOCKSIZE
        elif(action == "Move Right"):
            x += BLOCKSIZE
        elif(action == "Move Left"):
            x -= BLOCKSIZE
        block = pygame.Rect(x, y, BLOCKSIZE, BLOCKSIZE)
        for wall in walls:
            if block.colliderect(wall.rect):
                return state
        return x,y,walls

        Used to get the state after an action is used on a node
        returns the new state of the node
        
Used to get the state after an action is used on a node
returns the new state of the node
Used to get the state after an action is used on a node returns the new state of the node
def result(self, node, action):
        state = node.state
        x = state[0]
        y = state[1]
        walls = state[2]
        if(action == "Move Up"):
            y -=BLOCKSIZE
        elif(action == "Move Down"):
            y +=BLOCKSIZE
        elif(action == "Move Right"):
            x += BLOCKSIZE
        elif(action == "Move Left"):
            x -= BLOCKSIZE
        block = pygame.Rect(x, y, BLOCKSIZE, BLOCKSIZE)
        for wall in walls:
            if block.colliderect(wall.rect):
                return state
        return x,y,walls
def result ( self , node , action ) : state = node . state x = state [ 0 ] y = state [ 1 ] walls = state [ 2 ] if ( action == "Move Up" ) : y -= BLOCKSIZE elif ( action == "Move Down" ) : y += BLOCKSIZE elif ( action == "Move Right" ) : x += BLOCKSIZE elif ( action == "Move Left" ) : x -= BLOCKSIZE block = pygame . Rect ( x , y , BLOCKSIZE , BLOCKSIZE ) for wall in walls : if block . colliderect ( wall . rect ) : return state return x , y , walls
Used to get the state after an action is used on a node
returns the new state of the node
Used to get the state after an action is used on a node returns the new state of the node
'''
        Used to get the state after an action is used on a node
        returns the new state of the node
        '''
self
node
action