• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
deckar01 Avatar
Name:Jared Deckard
Clan:starfox
Member Since:Feb 2014
Last Seen:Feb 2024
Profiles:
Following:0
Followers:2
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (39)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • deckar01
    • resolved an issue on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    See https://www.codewars.com/kata/562086bbaacc2b4d13000047/discuss/javascript#657d1ac4dc8017ba924dd64e

  • Custom User Avatar
    • deckar01
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    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
    • dfhwze
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    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
    • typeError92
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    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
    • typeError92
    • created an issue for "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

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

  • Custom User Avatar
    • sizick
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

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

  • Custom User Avatar
    • dfhwze
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    Different enough, I guess. Approved at lowest rank available. Votes were really all over the place this time.

  • Custom User Avatar
    • deckar01
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    I don't believe this is necissary. The example test is just for developing the algorithm. Everything else in the full test suite (like hint validation) is for cheat prevention and has clear error messages.

  • Custom User Avatar
    • dfhwze
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    Before approving this kata, let's see if these kata's are potential duplicates of this one:

    • https://www.codewars.com/kata/62bf879e8e54a4004b8c3a92
    • https://www.codewars.com/kata/634f18946a80b8003d80e728
    • https://www.codewars.com/kata/61711668cfcc35003253180d
  • Custom User Avatar
    • dfhwze
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    Oh I see, sample test does not check on valid "hint" given by Anakin. Then it would be easy for users to write own test cases.

  • Custom User Avatar
    • deckar01
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    Any test case you choose is valid as long as there are two of each color, as mentioned in the description. The example tests are trivial to modify, run, and log/debug.

    In the real world you don't always have logging for a production system, and I'm ok with this kata being difficult if that teaches people how to think critically and learn how to write repro tests.

  • Custom User Avatar
    • dfhwze
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    How do you suggest users write tests if they don't know (yet) which are correct test cases? This kata is a total black box.

  • Custom User Avatar
    • deckar01
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    @dfhwze What purpose would that serve? Logging works for user tests.

  • Custom User Avatar
    • dfhwze
    • commented on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    If you disable console.log, you should provide an additional sample test with more than 2 colors.

  • Custom User Avatar
    • deckar01
    • resolved an issue on "Anakin's Colorful Protocol Droids" kata
    • 2 years ago

    console.log works fine while testing and is not intended to be available during an attempt. I don't think this is uncommon for sandboxed kata, and it does not appear to violate any of the authoring guidelines.

    Errors provide messages and reference the offending line. Combined with the test titles, the information should be sufficient for users to build their own test cases to reproduce any failures.

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...