• Custom User Avatar

    Yeeeeah guess the code length should have been restricted to prevent hardcoding - but it wasn't, so fair play xD

  • Custom User Avatar

    I love code golf katas, and my impression has been that they generally tend to be underrated for whatever reason.

    (And I'm also stuck, 217 characters and counting...)

  • Custom User Avatar

    Nice one! Think you could even shave off another three characters by replacing (1/2) with .5 :)

  • Custom User Avatar

    Lovely kata! It's crazy how different the solution for JavaScript is (has to be) from the one for Python, I've learned a lot about metaprogramming in JS! :D

    Only (very nitpicky) point of criticism: despite the example 'fire' for a weapon property (which I didn't notice was lower-case until afterwards...), the rule that the weapon name 'matches weaponOfSomething' suggests that all weapon names are camelCase; however, in the random examples, it seems that we can't assume that (I failed my first attempt only because of this and it took a while to find the cause); it's fine either way of course, but it could have been made more clear ;)

  • Custom User Avatar

    Bonusses of 0 and especially -1 (final two fixed tests) don't really make sense within the story, do they?

  • Custom User Avatar
  • Custom User Avatar

    The migration from the old expect utility to chai introduced this regression. I'm surprised there aren't any safeguards for expect calls that are never completed. There were a few other no-op expect calls that this report uncovered. Thank you.

    P.S. I initally reported this comment, because it read like a person just copying their solution into chat. In the future please mark the comment as an issue and reference the submission without publicly pasting the code.

  • Custom User Avatar

    No clue why that solution passes:

    // Validate Anakin's hint.
    var hint = String(anakin.hint(colors.slice()));
    it('Anakin should provide a valid guess', function() {
      if(colorOptions.indexOf(hint) >= 0) {
        chai.assert(true);
      } else {
        chai.expect(false, 'Invalid hint! (' + hint + ')');
      }
    });
    
  • Custom User Avatar

    See my comment on your solution and the issue raised in the discussion board - yes, this passes the tests, but I'd argue that this just means that the tests aren't doing what they should ;)

  • Custom User Avatar

    Props for finding this, but I feel like this is more of an exploit than an actual solution as it violates Condition 2 ("Anakin's hint must be a droid color."). I've raised this in the discussion and suggested that this should be enforced more strictly. I do admire the cheek though ;)

  • Custom User Avatar

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

  • Custom User Avatar

    Thank you! I agree that the description is ambiguous, I specifically went to the discussion board hoping that it wasn't just me xD

  • Custom User Avatar

    Nice kata! :)

    I would suggest adding two more aspects to the tests:

    1. some longer codes/messages, say > 150 characters, and
    2. some codes/messages containing a wider range of characters, say all printable ASCII characters or at least some of the special characters highlighted in the instructions.

    I think it's reasonable to expect a decoder to handle both, but currently it's possible to pass the tests with some solutions that can't ;)

  • Custom User Avatar

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

  • Custom User Avatar

    yes, only positive integers.

  • Loading more items...