Question: In the challenge levels, need to write weite java script program Bumper to map and solve the maze, go back to the start, and then

In the challenge levels, need to write weite java script program Bumper to map and solve the maze, go back to the start, and then race to the middle again.
So it's more visible what Bumper is doing:
When Bumper is exploring and mapping the maze, set the tail-light blue
When Bumper is returning to the start square, set it red
When Bumper is racing to the middle, set it green
There are a few maps for you to try your program on. You should use the same program for Bumper, we've just given you a few different mazes to try it out on.
Note, though, that the score isn't dependent on how many mazes you can solve, it's based on how your robot performs in one maze. (It picks up points for moving, turning corners, finding its way to the middle, etc.) We just don't tell you which one we'll try it out in.
One more thing: You're going to need to know how Bumper can find out where the goal is. The pixel coordinates of the goal can be found with getGoalX() and getGoalY(), but you just need to get Bumper into the right tile.
The tile index of that can be found with
let goalTileX = Math.floor(getGoalX()/64)
let goalTileY = Math.floor(getGoalY()/64)
(Take the pixel coordinates, divide by the fact tiles are 64 pixels wide, and round down because we were given the coordinate of the middle of the square.)
Or, shortcut: it's always in tile (5,5)
Maze:
 In the challenge levels, need to write weite java script program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!