Hi everyone ! I've been struggling with my last part of my homework so basically i have a grid that is N amounts of squares then i have the coordinates of my hero that are x,y , then we have D the maximum amount of moves the hero can make , P for the gold coins and p1 , p2 to pP the list of coordinates of the coins . So basically i have to find the optimized route to get the most coins possible . The hero can move in all direction (see the first picture .) and if they are two or more coins in his range he has to use a magic compass that scan the north , west and south-east and then where there are the most amount of coins the hero will go . and the response must be the coordinates that the hero moves and at the end the coins he gains .
i've done this much so far so i've got the list of coins and the coordinates and all the variables that i need but then i have no idea how i can setup the optimized route for the coins .
Thanks for the help ^^