Ad
  • Custom User Avatar

    Word replacements should retain case of their first letter. I have added another line to clarify this.

  • Custom User Avatar

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

  • Custom User Avatar

    You want to destroy all of the warbirds. If that doesn't help, Google "Kobayashi Maru" and it should be clear the type of approach you need to take. ;)

  • Custom User Avatar

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

  • Custom User Avatar

    I get what you're saying, but actually most of the rules do not have any priority. The only ones that are important are OMG, LOL, and word count, which should all be performed in that order. They are intentionally listed in this order in the description, so if you just work your way from the top down you'll be fine.

  • Custom User Avatar

    This should be case-insensitive. Updated the description to clarify.

  • Custom User Avatar

    Approved. I had to fork it to add in a test case which fixed an issue. (See discourse below.)

  • Custom User Avatar

    All the translations do this and I don't really see an issue with it, but of course I wrote this Kata. It's not technically randomized solutions, but they are selected in a randomized order... The main purpose of the "random" test is to prevent people from simply hard-coding solutions to each of the tests. You could hard-code 10 answers for the random test, but it would be statistically unlikely for them to be picked in just the right order to pass.

  • Custom User Avatar

    Good catch. Added a test case that should do the trick.

  • Custom User Avatar

    Good idea, but since this Kata relies on translating an entire string, I'm not sure how I would validate only one rule and still count the answer correct for a fully-complete translator. For example:

    Input: "Hi, how are you today?"
    Partial answer: "HI HOW ARE YOU TODAY?"
    Partial answer2: "HI HOW ARE YOU TODAY?????"
    Correct Answer: "HI HOW R U 2DAY?????"

    If the point of this test case is to test the capitalization, then I would need multiple cases for each possible step in the translation process. This is easy enough to resolve with this rule, as we can programmatically test if string.ToUpper() == string, but it becomes much more complicated with other rules, because the order in which rules are applied matters.

  • Custom User Avatar

    Bad choice of "words" on my part. ;) The description has been updated to indicate these strings should be replaced even if they are only part of the word.

  • Custom User Avatar

    GiacomoSorbi, that line is just phrased a bit awkwardly, at least from the perspective of a native English-speaker. I can understand what you are trying to communicate, but it would be much clearer if it were rephrased. Let me break it down:

    How many months he will...
    Should be How many months will he. I'm not a big enough grammar expert to explain why, and this won't alter the meaning of the sentence, but it does throw people off.

    ...will he have to save and...
    Will he have to save what? The assumption here is that he is saving money to buy a car, but the way the sentence is phrased it could sound like he is saving months. (Remember that we started the sentence out with months, and we have not made any mention of money in this sentence. It sounds like months is the subject and "save" is the verb that describes what he is doing with the months.)

    ...how much it will remain...
    How much what will remain? "It" is a very vague (unclear) word. Again, since you have not made reference to money in this sentence, it isn't entirely clear that the "it" you are talking about is money. I can assume it is by the context of the problem, but it still could be a bit more explicit.

    ...when he has paid the car he wants to buy.
    He pays for the car, he does not pay the car. Once again, I don't think anyone should have trouble figuring out what you meant to say by this, but it just makes the sentence sound awkward.

    The combination of all this awkward phrasing makes it harder for someone to understand what you're saying, especially if the reader does not have strong English skills themself. Here is a possible rewording:
    How many months will it take him to save up enough money to buy the car he wants, and how much money will he have left over?

  • Custom User Avatar

    I can see where you're coming from. I feel like the definition of a Kata is hardly clear, and is still evolving. When creating a Kata, one of the "Disciplines" is Puzzles: "Code that is fun to play and involves solving puzzles that may not be strictly programming challenges." There are several Kata already on here that are not really difficult to program, it's just finding the "secret" that's a challenge. This is very similar in that respect, but in a way, each of the rules could be a Kata on their own. (And some of them are. hint hint) If there were just a single one for each test, this wouldn't be much of a puzzle at all; it is the particular combination that makes it interesting to try and figure out what rule does what.

    But you are right that implementing a decoder for each one is much easier than figuring out what you need to do. That's kind of the point, though. I think this is the perfect example of a puzzle for people who like mental challenges, but aren't necessarily experts at math or programming. (Like many of the 4 kyu and up Kata demand.)

    Furthermore, programming skills are not limited to knowledge of a particular language. Logical reasoning skills play a huuuuge role when programming in any language, particular when you're trying to troubleshoot a bug. I get that it's a little outside of the box, but I think there is value in training logic skills even without challenging programming, and that it will improve your programming in a subtle way. On a side note, I don't think there is anywhere more suitable for this kind of puzzle. (I mean really, what are you going to do, give someone ten choices and then have them guess which one of those was used to encode the text? That would be boring and easy. It's much more interesting and rewarding to solve off of a blank slate!)

  • Custom User Avatar

    Glad you enjoyed it and didn't give up. :)

  • Custom User Avatar

    Thanks! Description is fixed now. :)

  • Loading more items...