Ad
  • Custom User Avatar

    @fstnando77

    From Kata description:

    Sometimes a line may be valid in one direction but not the other. Such a line is still considered valid.

  • Custom User Avatar

    I agree with amitznati. In the following case (Good5):

       +-------+          
       |      +++---+     
    X--+      +-+   X 
    

    You are also not 100% sure which path to take, however return true.

  • Custom User Avatar
  • Custom User Avatar

    Did you read the hint in the Kata description?

    Imagine yourself walking a path where you can only see your very next step. Can you know which step you must take, or not?

    If you are not 100% sure which step you must take then line is not valid.

  • Custom User Avatar

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

  • Custom User Avatar

    Sorry, I didn't understood what it mean ambiguity in terms of paths, maybe its lingo diffs...

    you will get to a junction. Do you turn left or right? You don't know...
    What does it mean?

    If I can go left (didn't stepped on this cell before) I'll try to go left, same for right...

    can you please clarify this condition?:
    "It must be possible to follow the line with no ambiguity"

    Seems like I'm not the only1 struggling with this condition..

  • Custom User Avatar

    It must be possible to follow the line with no ambiguity

    • e.g. When starting from bottom-right X you will get to a junction. Do you turn left or right? You don't know...
    • e.g. Similar can happen when starting at the left-side X

    Since the line is not "valid" in either direction then it is not considered a valid line.

  • Custom User Avatar

    I read the discussions, and I still don't get why it's invalid test:

        +-+
        | |
        ++++
        ++++
       X+++
         +---X
    

    there is only one path forward and backward, isn't it?

    is it possible to pass on corner twice but to different directions?