Ad
  • Default User Avatar

    Cool! I didn't know you could leave out the ternary operator.

  • Default User Avatar
  • Custom User Avatar

    The last code block has this spec. Closing.

  • Custom User Avatar

    fixed here

  • Custom User Avatar

    approved by someone

  • Custom User Avatar

    JS Fork to address this suggestion. Also fixes description, increases documentation, and adds very minor test enhancements

  • 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

    This. It's driving me nuts

  • Custom User Avatar

    Interesting Kata for exploring generators!

  • Custom User Avatar

    Took 2 weeks to solve, but I had a lot of fun, and learned a lot on the way!!

  • 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

    So calling two separate where-filters is a logical AND, while combining two where-filters in one where-call is an OR?

    // SELECT studentName, teacherName FROM teachers, students WHERE teachers.teacherId = students.tutor AND tutor = 1
    query().select(student).from(teachers, students).where(teacherJoin).where(tutor1).execute(); //[{"studentName":"Michael","teacherName":"Peter"}] <- AND filter
    // SELECT * FROM number WHERE number < 3 OR number > 4
    query().select().from(numbers).where(lessThan3, greaterThan4).execute(); //[1, 2, 5, 7] <- OR filter

  • 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

  • Loading more items...