Ad
  • Custom User Avatar

    Modified the description so it aligns a bit better with the test cases. Sadly, I can't change the test cases to make sense without invalidating 447 solutions.

  • Custom User Avatar
    • Why do you prefer minimalist code and not an OOP boilerplate? (And why that would be an issue?)
    • By test driver you mean the example test code?
    • The Kata doesn't use random for spacing please read the description again.
    • If you want text abbreviated please make a new comment and tag it as suggestion to polish on it's own discussion thread.
  • Default User Avatar

    Gee I'm so relieved at least ONE other person knows how to use (or write) clamp and abstracting away pixel access/manipulation a bit. +1

  • Default User Avatar

    C++ version requires very spotty error checking. E.g. trailing garbage at the end is simply to be ignored (WTF) UNLESS (found empirically) it starts with ')', '|' or '*'.

    It could be that more arbitrary continuation characters should trigger parse failures, but I happened to not hit them with the random test cases I received.

    Please, let's make sure that katas teach PROPER programming principles, such as:

    1. consistency
    2. input validation (don't just silently accept/ignore trailing garbage!)
    3. have an interface that allows non-leakage (right now, it's very easy for the parser to have built RegExp instances, but never free them - in fact we don't know how they're allocated)
  • Custom User Avatar

    What do you not understand?

  • Default User Avatar

    The test cases testing for exception in C++ are wrong:

    It(should_throw_if_lives_ran_out)
    {
        Guesser guesser(10, 2);
        guesser.guess(1);
        guesser.guess(2);
        AssertThrows(std::exception, guesser.guess(10));
    };
    

    The description clearly states that

    • If the user tries to guess WRONG more than the limit the function should throw an error
    • correct guesses DO NOT consume lives

    I'd expect the function to throw at the second guess, or MAYBE at the first next WRONG guess. Not at the third guess when that guess is actually correct

  • Default User Avatar
  • Custom User Avatar

    The macro was an ugly hack I did mostly due to being upset about the Javaisms of this Kata. I realize now it could have been done better by forwarding the call to my function in a Carboat class, or importing my function to a Carboat namespace.

    Also, you don't actually need using namespace std; to pass.

    When I submitted this solution it would come back with compile error if I didn't include that line. The hidden full test suite needed it. The "quick check" tests already included it, so it wasn't that.

  • Default User Avatar

    May well be the only person to use regex here :)

  • Default User Avatar

    The flaw is in the kata writer's logic

    And arrogance. "XXX people completed the kata" doesn't (at all) mean it's above criticism. It just means all code warriors have stamina and pitbull mentality.
    Which is great, because programmers need that.

    Translating that to "my description is perfect" is just nonsense. Ironically, a programmer with good sense of logic would realize that. But that programmer would read the question the way we all did, as opposed to how the author reads it.

  • Default User Avatar

    I get your frustration. I too read the problem in the "sensible way". Just accept that it wasn't intended to have any real-life useful meaning, and it's basically a sequence-manipulation trick. Either bit the bullet or skip the kata (I wouldn't blame you, it's just my OCD keeping me here)

  • Default User Avatar

    The wording "Furthermore the percent of loss [...]" clearly implies that it only goes for the depreciation of the OLD car, not the new (that's a WIN, not a LOSS)

    The major complication is the value of both cars is decreasing (i.e. depreciating). They both decrease by the same percent per month, 1.5% for our first test. Additionally, the amount of depreciation increases by 0.5 percent every second month.

    is WAY more accurate. (thanks to designerzim)

  • Default User Avatar

    Indeed, especially

    The major complication is the value of both cars is decreasing (i.e. depreciating). They both decrease by the same percent per month, 1.5% for our first test. Additionally, the amount of depreciation increases by 0.5 percent every second month.

    is WAY more accurate. I'm filing an issue because "Furthermore the percent of loss" clearly implies that it only goes for the depreciation of the OLD car, not the new (that's a WIN, not a LOSS)

  • Default User Avatar

    Good style. Consider using a proper random generator (std::mt19937 e.g.)

  • Default User Avatar

    @g964 of course it is. Changing the parameters of my compare predicate to int16_t very much makes the tests fail due to overflow.

  • Loading more items...