Ad
  • Custom User Avatar

    There's supposed to be a device.encode defined (you cannot see the definition--it is a black box and it is your task to figure out how it works). It works for me as of today, at least; not sure why it'd be undefined for you. It might've gotten fixed since you tried the kata.

  • Default User Avatar

    It was partially intended to be a humorous solution, but it was also intended to 1) shine a light on the lack of enforcement of the kata's stated task and 2) reflect my general dislike for being forced to accomplish a task a specific way.

    Personally, I prefer when a kata doesn't set specific limitations on how a task should be solved, allowing the solver more creative freedom in their solution. That said, there is also a lot of value in a kata which trains in the practice of a particular mechanism or technique!

    However in this case, the kata says it wants the solver to validate a password using a regex, but it only enforces the "validate a password" part. I posted this solution very early in the kata's beta period to highlight an area where this kata could have been improved, and I would have been pleased if the kata had been amended to enforce the regex requirement. The issue was also raised by another user on the kata discussion page during the beta.

    Also, my intention is not to single out or demean this kata's author (or any kata's author), but I write abusive solutions like this whenever I can, for a variety of reasons that I like to think are not particularly malicious.

    The bottom line is that I believe all kata should be held to a high standard, and if a kata stipulates a problem requirement, it should also be able to validate that the solver fulfilled that requirement.

  • Default User Avatar

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

  • Custom User Avatar

    Thumbs up for this kata i general... the question if the Adam() and The()-only solution is cheating, i would say.. it solves the specific problem, but can't be used for anything :) I would like it, if the focus for web developers was for generic solutions and not single case ones. We are not fighting to pass the tests we sat up, but building to solve a use case, right?

    Nevertheless, it was funny.

  • Custom User Avatar

    As already mentioned in other places: it's OK to do it that way, since the description clearly says "in order to create the following sentences", not "any possible sentence". Those solutions simply fulfill the requirements ;)