Ad
  • Custom User Avatar

    +1 for visibility

  • Custom User Avatar

    Good catch. Should be fixed now. Thanks for your feedback.

  • Custom User Avatar

    Good point!

    Will change it immediately!

  • Default User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Your Line.new() can return an object. And the pool can just be some variable somewhere that is referenced by Line.new(). Does that help?

  • Default User Avatar

    Thank you very much for the feedback. This is my first kata and I appreciate the advice. I have cleared up everything you outlined and republished.

    Note: I keep getting a time out error when updating this. I'll get the changes pushed out once I can get a connection.

  • Custom User Avatar

    You're welcome!

    I have added some more tests to detect the use of intToChurch function. In any case, I think this is not really necesary because if you use intToChurch, you should get a stack overflow error.

  • Default User Avatar

    That one's actually already covered. Thanks though!

    var returnNoSub = "   \t \n\t\n \t\n  \n\n\t\n\n\n\n";
    
  • Default User Avatar

    In the description, I added "A label may be declared either before or after a command that refers to it."

    As a test case, I added a no-exception edge case:

    var jumpPass = "   \t\n   \t \n   \t\t\n\t\n \t\n \n\n\t\n \t\t\n \t   \t\n   \t \n\n  \n\n\n\n";
    

    This includes a valid sequence of code containing a substring that could be interpreted as a label, but should be attributed to other commands.

    Reviewing your code again, it seems I should do the same for the clean termination test case. (now added)

  • Default User Avatar

    Can't really think of a concise way to describe that off the top of my head, but when I do, I'll add it to the description. The way you implemented forward labels though, I'm not sure it should work 100% of the time, so I might add a couple more test cases if I can find a way to break your solution.

    The easy way is just to do two passes on parsing the code, doing nothing but collecting labels on the first pass and everything else on the second pass. The "lazy" way, where you don't collect the labels ahead of time, is definitely harder to implement.

  • Custom User Avatar

    Glad you liked it - and you are correct with the wiki link.

  • Custom User Avatar
  • Custom User Avatar

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