Answer the question
In order to leave comments, you need to log in
Labyrinth "Diagonal" in c#. How to do?
Good afternoon. They asked me to make an algorithm that allows you to pass the Diagonal Labyrinth.
I don’t understand something: how to determine how much to go down and move to the right?
The robot has a command robot.MoveTo(Direction. <--- left, right, up, down), as well as bool robot.Finished
Here is the method itself:
public static void MoveOut(Robot robot, int width, int height)
{
}
Here you can see that the width and height are given as input, as well as the
PS try catch robot commands cannot be used, the method is no more than 12 lines
Answer the question
In order to leave comments, you need to log in
If there is no check for the presence of a wall, then I can only offer to reverse the maze drawing algorithm, apparently, this is a modified Bresenham algorithm. I even wrote an article about it , the code can be viewed here . You just need to change the drawing condition a bit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question