Question
Hello! I need help creating a jeroo smart enough to navigate a simple maze, picking all of the flowers and disabling all of the nets.
Hello! I need help creating a jeroo smart enough to navigate a simple maze, picking all of the flowers and disabling all of the nets.
The starting position for your jeroo will always be the southeast corner of the island at (width - 2, height - 2).
After running the maze, the jeroo should always end at the ending position, which is at location (1, 1).
The catch is that Maze Island changes every time. Sometimes it is wider, sometimes narrower--the only constant is that it is rectangular and surrounded by water. Flowers can grow anywhere and everywhere on the island. Also, there may be up to fifteen nets located on the island, although there will never be a net at the starting position.
While there are many strategies for navigating through a maze, one easy strategy is to simply hug the righthand wall as you walk through the maze---eventually make it all the way through the maze, back to your starting position (hugging the lefthand wall also works the same way, as long as you always stick to one side). If you traverse the maze completely, ending back at the starting location you are then ensured that all the flowers and nets have been cleared. Then your Jeroo simply needs to hop to the northwest corner. You can use this strategy to create a simple maze walker (or runner) with just a few lines of code. Other strategies are possible, of course, so use the one you find easiest to understand. It is expected to write software tests to confirm your solution works the way you intend for this assignment. Write a test class for your jeroo called MazeRunnerTest. Ensure that your test class checks all of the methods you have written.
Further, I have to write software tests to demonstrate your jeroo can handle this task. I am lost in the part of creating new classes and things like that., this is a programm called greefoot sofia. If someone could help me with this I would appreciate it a lot. I posted one of the possible mazes, they change everytime I try to compile a code. Also I dont know if there is enough information to help me, so if someone can help me with this that would be good too! I have posted this question, i just want to see other kind of structure if possible. This is one of the possibles mazes, it is not neccesarily this maze.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started