Ad
  • Custom User Avatar

    It's good that this errored because this means the tests were using the user's submission solution as the reference solution, which is dangerous

  • Custom User Avatar

    that answer is from way before chatgpt was a thing lol

  • Custom User Avatar

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

  • Custom User Avatar

    It's bad practice to remove them. It's relying on the tests to include them instead, which leaves these solutions prone to being automatically invalidated in the future if the tests change and their solutions don't compile anymore. The line or two saved by omitting them isn't worth that risk, so you're doing good by keeping them in

  • Custom User Avatar

    I've left TypeScript for a year, and this was my return to form to it after flirting with C++'s metaprogramming instead and oh boy. TypeScript's type manipulation is both lightyears ahead and lightyears behind other languages. This was one of the most frustratingly entertaining exercises on this website, 10/10

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Weird extra unnecessary step is expected. Adds nothing to the task.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Consider storing the user's answers in constexpr variables then using the regular Assert::That syntax instead of static_asserts. This way, the program still checks compile time behavior, but can still compile and provide meaningful feedback (via ExtraMessage) instead of just refusing to compile and giving a vague assertion failure message.

  • Custom User Avatar

    It's a variable template. In this particular case, making it not a function probably forces more creative solutions

  • Custom User Avatar

    An answer two years too late, but your code returns the incorrect result when T is unsigned. The vs function is where the problem lies.

  • Custom User Avatar
  • 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.

  • Loading more items...