Ad
  • Custom User Avatar

    The anticheat tests are incorrect and fail the reference solution too.

    1. The isUniversal anticheat: This line in generate
    expect(your_result.isUniversal(), "isUniversal").to.equal(false)
    

    Will incorrectly cause unconditional failure for some test cases. For example, if your random tests run new FunctionalSet([D]).difference(new FunctionalSet([D]).difference(new FunctionalSet([C]))).not() (which should, in fact, be universal).

    1. For the anticheats, the variables in the tests are scoped in a problematic way (namely your_result, my_result and _it). By scoping them outside the test loop, every single it block will be reading and writing to/from the same references. This is a problem because Chai sets up the fixtures way before any of the it blocks are run. Before any it is run, these variables would have had their values overwritten on each loop, until they settle on the values from the final iteration. So the end result is basically your_result, my_result and _it having the same values on each run. Since the titles of the it blocks are also precomputed, they do NOT match what is really being tested.

    2. The anti cheating memoization test: The functional set argument returns a string instead of a boolean. Discussed in the issue below mine by Invariance.

  • Custom User Avatar

    Something is wrong with the Duplication exception tests

    TSError: ⨯ Unable to compile TypeScript:
    test.ts:608:16 - error TS18046: 'e' is of type 'unknown'.
    
    608         expect(e.message).to.equal('Duplicate ' + duplicate);
    

    I did comment it out from my sample tests, and it allowed my solution to pass all tests.

    I also, tried other users solutions, and they do not pass this test case as well.

  • Custom User Avatar

    Python new test frameworks are required.

  • Custom User Avatar

    Missing mutable test cases for takeWhile.

    var list = ArrayComprehension({
      generator: "1..",
      mutable: true
    });
    
    Test.assertSimilar(list.takeWhile(n => n < 5).value(), [1,2,3,4]);
    Test.assertSimilar(list.takeWhile(n => n > 4).take(4).value(), [5,6,7,8]);
    
  • Custom User Avatar

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

  • Custom User Avatar

    The kata's description is horrendously lazy. And it leaves a lot of specs out of the table, even in the context of the linked Wikipedia article:

    • Which version of the LZW do we need to implement? There are two versions listed in the linked Wikipedia article (fixed 8-bit to 12-bit, or the variable width version), but the kata does not mention which version it desires.
    • What unit are we compressing? Characters, or bytes? Note that most LZW implementations process bytes and not characters. Meanwhile, there are no restrictions on the input string, so it can contain non-(extended) ASCII characters, which cannot be expressed in 1 byte, and has to be explicitly encoded; depending on the encoding they give different bytes. The tests doesn't contain anything other than [A-Z# ], but this is really because the tests are too lazy.
    • Speaking of which, the return result should really be an array of integers, not a joined string. This prevents the kata from being translated to other languages.
  • Custom User Avatar

    There are no tests that validate stop is handled correctly. Every test can be passed by processing every character except the last (and ignoring stop altogether).

  • Custom User Avatar

    Python translation

    Implemented random tests to match o2001's implementation as much as possible.

  • Custom User Avatar

    These edge cases should also be tested since they are present in example tests:

    • [1..9,12..15] -- invalid since one single range is allowed

    • [1,2..20,25] -- invalid since a range has to be the final item

    • [1,2,3..20] -- invalid since at most one inidivual element can be provided before a range

  • Custom User Avatar

    These edge cases should also be tested since they are present in example tests:

    • [1..9,12..15] -- invalid since one single range is allowed

    • [1,2..20,25] -- invalid since a range has to be the final item

    • [1,2,3..20] -- invalid since at most one inidivual element can be provided before a range

  • Custom User Avatar

    It seems a bit odd to me that vowelSet.includes(A) is required to throw an error when such problems are decidable (determining if a finite set is a subset of any other set). Should it really be required that the implementation fails when it doesn't have to?

  • Custom User Avatar

    I'm failing exclusively on four "anti cheating memoization test"s (without cheating or using memoization), so either that test is misconfigured, or my solution is bad and some other "normal" tests (not related to cheating) are missing.

  • Custom User Avatar

    First off, thanks for putting this together, it's been a fun challenge. However, I seem to be running into an issue with my attempt. The first attempt, I passed all tests but the performance test. My second attempt, after some minor code cleanup, is now failing all of the "anti cheating" "edge case" tests, but I haven't functionally changed anything.

    Any idea what the issue could be? I put a good amount of effort into my solution, so it's a bit frustrating to fail in a way that I cannot identify.

  • Default User Avatar

    The JavaScript in the description and initial code is quite ancient. Decorator should be a class, and spread parameters should be used instead of using Function.prototype.call() on the arguments object.

  • Custom User Avatar

    The if outer observable never completes, then concatMap either and if inner observable never completes, then concatMap either tests are completely undecipherable.

    Please actually explain what are the expected behaviours of the 3 operators required to be implemented.

  • Loading more items...