Ad
  • Default User Avatar

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

  • Default User Avatar

    An interesting kata on first glance, but hard to implement because the spec for the shifting algorithm is unclear. It says that each “plaintext letter” is shifted, but does not specify a) what a plaintext letter actually is and b) in which order they appear in the alphabet. My guess is a-z from the English alphabet, but that’s just a guess. Since that information is a vital part of the algorthim, it should be added to the description.

  • Default User Avatar

    Clever! That’s what you get when you take TDD too literally. :D

  • Default User Avatar

    A little too clever for its own good. Because how map’s operator[] works this inserts every non-smiley string into the map, growing it continuously. In the real world something like this can be the cause of a crash or mysterious slowdown that happens once each day/week/month and is virtually impossible to reproduce.

    But it’s a great example for why using const as often as possible is an excellent idea. If mp was const the code wouldn’t have compiled and the bug wouldn’t be out in the wild.