Ad
  • Custom User Avatar

    There is no only mathematic!
    Description is true.
    You should know sewing strictly for solving this kata ))
    And use google if you don't hang curtains often.
    Then it's realy 7 kyu kata.

  • Custom User Avatar

    I was going to fork this kata and update the description to one which makes the author's intent the only valid interpretation, but I can't think of how to do so without taking away the "puzzle" aspect of the kata.

  • Custom User Avatar

    I agree that the description is definitely vague and requires a lot of "guess what the author was thinking", which really isn't great. There are many other possible solutions (such as your suggested three-fold technique), and they can produce valid arrangements which use fewer hooks. A curtain with length 240 and hooks spaced apart at most 80 units would require 5 hooks according to the author, but your technique only uses 4 while satisfying the constraints, for example.

  • Custom User Avatar

    This is a terrible problem statement to inflict on beginners. We're told not to use any kind of measurement, but we're not given any indication of what moves we are allowed to use. The author just assumes that their solution is canonical and that anyone can be expected to reach the same conclusion. Personally, I would hold one end of the curtain in my left hand, loop it around some fingers of my right hand, then back around the fingers of my left, then grasp the other end in my right hand, and pull them taut so that the curtain is exactly tripled over. In principle, this procedure could be repeated until the folded length is small enough. But that's not the intended solution, so it's "wrong".

  • Custom User Avatar

    Approved

  • Custom User Avatar

    COBOL translation (author is inactive).

  • Custom User Avatar

    I think description is lacking a bit, the task itself is interesting.
    I only solved it easily because I have done such thing before in real life.

  • Custom User Avatar

    Very interesting and tricky.

    I think a image could make the description clearer an do justice to this underrated kata.

  • Default User Avatar

    Find the half without the ruler =)

  • Custom User Avatar

    9 is the wrong answer because you should have 10 hooks.

    One corner of your curtain is hanging unsupported.

  • Default User Avatar

    I absolutely agree with you, this situation also causes misunderstanding :(

    and then in the second example where the length of the curtain is 180
    [0-20][20-40][40-60][60-80][80-100][100-120][120-140][140-160][160-180]
    the maximum permissible length between the hooks is 22, and I have only 20. Why then 9 is the wrong answer, where did 17 come from?

    and please note I don't measure anything, I just fold the curtain in half ((((

  • Custom User Avatar

    You're not crazy. But how are you going to measure 45? You can't, not in this kata.

    You can only get 112.5 from 225 without measuring.

  • Custom User Avatar

    This is just bizarre. The first test expects a result of 9 on a test of numberOfHooks(225, 45) ??
    45 is a factor of 225.

    Consider brackets ([]) as the external hooks and pipes (|) as inner hooks.
    [0 - 45 | 45 - 90 | 90 - 135 | 135 - 180 | 180 - 225 ]

    Count 'em. 6.

    Am I crazy or is this kata nuts?

    The hell is going on here?

  • Custom User Avatar
  • Custom User Avatar
  • Loading more items...