Ad
  • Custom User Avatar

    I am unsure as to whether it is checking whether the type is equal or the content of whatever datatype is equal. For lists it wants the content to be equal, but for the counters it simply asks for the type to be the same, not the content. Please clarify this. Thanks. Interesting kata.

  • Custom User Avatar

    needs to be rewwritten with the new framework

  • Custom User Avatar

    Please do not round ( or truncate ) floating point values. Compare with a margin for error ( assertApproxEquals in JS ).

    If I get 10.00039999999999999999 instead of 10.000400000000000001, I'm still screwed. Rounding instead of truncating just moves this problem by 5e-something.

    NB: Math.hypot gives different answers than Math.sqrt.

  • Custom User Avatar

    Sorry, it's a duplicate of Bug's life: https://www.codewars.com/kata/bugs-life
    Good attempt. Continue trying and you'll be publishing good katas in a short time.

  • Custom User Avatar
    • use snake_case for python function naming, not PascalCase.

    And why the fuck the rounding? That leads to situations like this:

     Basic Tests
    10.8167 should equal 10.8166
    Test Passed
    Test Passed
    Completed in 0.12ms
    Random Tests
    Length = 524, Breadth = 902 and Height = 386
    1281.29 should equal 1281.2899
    Completed in 0.03ms
    Length = 133, Breadth = 863 and Height = 806
    1275.3392 should equal 1275.3391
    Completed in 0.02ms
    Length = 117, Breadth = 639 and Height = 382
    810.754 should equal 810.7539
    

    To avoid float point comparison truncate the result to 4

    -> just... "lol!" x/

    => Use proper float testing: Test.assert_approx_equals(act,exp,precision)

  • Custom User Avatar

    I don't know in what universe you live, but here, on Earth, I can measure 6 litres with 3- and 5-litre jars:

    1. fill 3-litres jar
    2. pour everything into 6-litres jar
    3. fill 3-litres jar
    4. pour everything into 6-litres jar

    The same goes for 10, 20, 100 case.

    Maybe you should specify that C has to be less than B in the description?

  • Custom User Avatar

    Apparently, b > a. But this is not specified. ( The example solution would fail A = 5, B = 3. )

    Also, there is no "demand jar" C, there is only a "demand" C. Giving us the jar would make it a bit too easy .. :P

  • Custom User Avatar

    warning, your random tests will rarely generate a True answer. Don't rely on luck, create a random execution in the loop that will automatically expect True:

    for...
        ...
        ...
        if randint(0,1): #expect true
        else:            #expect false
    
  • Default User Avatar

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

  • Custom User Avatar

    There is only one possible solution within the character limit.

    That is not the making of a good kata. There should be room for creativity.

  • Custom User Avatar

    Solution should be less than 19 characters

    The length of your code is 17 characters, it needs to be less than or equal to 16 characters

    Changing the length restriction to make it artificially harder to avoid downvotes? What a smart boy.

  • Custom User Avatar

    This is not new.

  • Default User Avatar

    unique is tested against isUnique instead of a reference implementation.

  • Default User Avatar

    Function names in Python should be in snake_case.

  • Default User Avatar

    The tests expect function to be available as both isUnique and unique.

  • Loading more items...