Ad
  • Default User Avatar

    I am still confused, here is how i look to this:

    Example 1:
         1 ##############      1 ############## 
         2 #        \   #      2 +--------\   # (2, 0)? or (1,0) if starts with 0
         3 *   \        #  =>  3 *---\    |   #
         4 #            #      4 #   |    |   #
         5 #   \    /   #      5 #   \----/   #
         6 ##############      6 ##############
           12345678901234 = 14 
    Example 2:
          1###*###      ###*### 
          2#/ /  #      #/-/  # 
          3#     #  =>  #|    #
          4#     #      #|    #
          5#\    #      #\----+ (5,7) or (4,6) if starts with 0
          6#######      #######
           1234567 = 7
    

    Am I misunderstanding something here?

  • Default User Avatar

    How first answer of is equal to (0,1)? Isn't it (1,0)?

    Describe(exit_from_maze_tests) {
      It (passes_example) {
        Board m {
          "##############",
          "#        \\   #",
          "*   \\        #",
          "#            #",
          "#   \\    /   #",
          "##############"
        };
        Assert::That(exit_from_maze(m), Equals(Result({0, 1}, 22)));
      }
    

    The same second example: it should end on (5, 7)! how it is (6,4)?

     It (passes_second_tests) {
        Board m {
          "###*###",
          "#/ /  #",
          "#     #",
          "#     #",
          "#\\    #",
          "#######",
        };
        Assert::That(exit_from_maze(m), Equals(Result({6, 4}, 10)));
      }
    };
    

    I am totally confused, with how answers have gotten? Can you explain me, please!

  • Default User Avatar

    If there is no help, where i can find some hints?

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Checked the code, answers is correct, however output says:

    Expected: equal to another value

    Actual: some value

    Havent' seen that type of question in the comments bellow.

  • Default User Avatar

    Thank you very much for quick and comprehensive reply. I do appreciate that!

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Can anyone help me, i have this error "UndefinedBehaviorSanitizer:DEADLYSIGNAL...". I have no clue why.

    P.S. Below said, that return type dynamically allocated string, when there is just string type function. Am I missing something?

    I am returning simple string type.