Ad
  • Custom User Avatar

    ok. Understood. I will look into fixing that. However, Im currently way north of the arctic circle with very spotty internet, so will take a couple of days

  • Custom User Avatar

    Python translation. Please, review and approve.

  • Custom User Avatar

    I understood that you want to handle them differently, it just makes little sense logically. But it's your kata, your design choices.

  • Custom User Avatar

    You cut the text, it says:
    "This can be solved by translating any instruction to turn the dial left, to a corresponding right turn. A left turn of 11, for example, would leave the dial at label 8, which means that the smallest equivalent number of turns to the right is 7."

    And there is an example with a turn to the right of size 10, so should be more clear now.

    I want them to be handled differently.

  • Custom User Avatar

    I made it like that such that it would be different handling for L and R

    But why..? The description states:

    the smallest equivalent number of turns to the right

    Seems like 1 is < 10, so the 2 handlings are inconsistent.

  • Custom User Avatar

    If you skip reading the first part of description (backstory), like I often do, it's not mentioned anywhere how many dials there are, so the task becomes confusing.

  • Custom User Avatar

    Markin this as solves. As this is specified in the description and I have motivated the reasoning elsewhere in these threads.

  • Custom User Avatar

    Could you elaborate, not sure that I follow.

  • Custom User Avatar

    As I wrote in another thread:

    The reason I decided to filter out anything that was divisible by 9 is that I do not think a Dial Combination Safe ever would have a sequence where the same label showed up in sequence.
    I do not think one of those old lock ever could have a password combination that was, for example, 1-2-3-3-5 since going from 3 to 3 means not turning the dial at all.

    So, to fit into the narrative a bit, I decided that the passwords here also would not have any such sequences.

  • Custom User Avatar

    Hi, the reason I decided to filter out anything that was divisible by 9 is that I do not think a Dial Combination Safe ever would have a sequence where the same label showed up in sequence.
    I do not think one of those old lock ever could have a password combination that was, for example, 1-2-3-3-5 since going from 3 to 3 means not turning the dial at all.

    So, to fit into the narrative a bit, I decided that the passwords here also would not have any such sequences.

  • Custom User Avatar

    That is actually by design. I made it like that such that it would be different handling for L and R.
    The only reason I made the answer take a product of R-turns and the label it landed on, was to force the user to translate the L turns into R turns at all.
    And since any L turn could be translated to different number of R turns, depending on how many full rotations, I decided to put in that info for the Left turns.

  • Custom User Avatar

    It is specified for L

    Hmm you're right... Still, the inconsistent handling needs to be addressed.

  • Default User Avatar

    It is specified for L "which means that the smallest equivalent number of turns to the right" -> smallest equivalent number
    and for R the cases show that we should not use any modulo.

    Though the description could be more clear, and it doesn't make much sense that there is different modulo behavior for R vs L.

  • Custom User Avatar

    It would be more helpful to have information about number of dials when describing task itself, not just part of the story.

  • Custom User Avatar

    If 10 * 'R' is the same as one move to right, why must we use 10 when calculating result? It seems different from calculating steps left, for 'L' * 10+, and that behavior isn't specified either.

  • Loading more items...