Highlights
Task:
v4.1:
Another question that IActors can ask the map is what has been found in the area around it. For this we have a method GameMap :: getNeighbourhood which takes a location and an integer “dist” anse as an argument, and returns all the locations within “dist” steps from the location.
For example. if a role is on a loc, and:
- ask for the neighboring field with dist = 1, then the 8 fields around the loc should be returned.
- ask about the neighboring field with dist = 2, then the 8 locations around the loc should be returned together with the 16 locations that are and step further out. etc.
Implement the GameMap :: getNeighbourhood method.
4.2:
When a role wonders which locations are nearby, it is not interested in locations with walls. Improve the GameMap :: getNeighbourhood method so that it does not return locations that are walls.
4.3:
Go to IGameMap :: getNeighbourhood and sort the list of locations before returning it. IList :: sort needs a Comparator <Location>, here you can use “LocationComparator” which takes one location and compares the distances to two other locations.
You can use: Collections.sort (neighborhood, new LocationComparator (loc));
Improve the GameMap :: getNeighbourhood method so that it returns locations in sorted order
4.4:
Sometimes a location can be close but difficult to reach because other IItem is in the way. You will find the locations that are possible to reach at dist number of steps.
5.3:
Run the tests again and see if the rabbit does better now. If you manage to get even more tests in TestRabbitStrategy to pass, it can pay off for creativity. (You do not have to pass all the tests to get a full pot on this one.) Improve Rabbit's AI. Write in answer.md what you have done / tried / thought.
Tip 1: The point is not to give Rabbit superpowers, it is to make Rabbit behave normally in the game.
You may have seen games where an AI is stuck and just goes straight into a wall or something? It does not look professional.
Tip 2: GameView :: getNearbyItems is already implemented, but maybe you can make a small change to the implementation to make it a little more usable?
This IT Assignment has been solved by our IT Experts at My Uni Papers. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.