Ad
  • Custom User Avatar

    On Haskell there is a bug in testing code:

    In random tests, for example, having a list of monomials: ("", -1), ("b", -9), <...>
    so, the system says:
    expected: "--9b+ <...>"
    got: "-9b <...>"

    Obviously, that testing code doesn't work correct for monomial "-1", because, it reduces that to "-" (like "-1a" should be reduced to "-a")

    So, could you please, check this behaviour and fix it?

    Regards

  • Custom User Avatar

    Python fork (author gone)

    • proper use of the test framework
    • random tests (fixing this issue)
  • Custom User Avatar

    How do I understand which tests were used in the section "More complicated tests"? Otherwise I won't understand how to fix the code. All other tests are solved correctly.

  • Custom User Avatar

    In Haskell the test logs should provide the input, at least in case of fails.

  • Custom User Avatar

    Random tests in Haskell sometimes generate cases with constants:
    [("abcy",-14),("",-8),("axyz",-9),("bcdz",-3)],
    or with coefficients equal to zero:
    [("abz",15),("abcx",10),("adx",-6),("abcdxyz",9),("axz",0),("abc",3)].
    It makes the task more fun, but it contradicts the rules laid down in the description:

    the string in input is restricted to represent only multilinear non-constant polynomials.

    I'd suggest either changing the description or fixing random tests.

  • Custom User Avatar

    Ruby 3.0 should be enabled.

  • Custom User Avatar

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

  • Custom User Avatar

    One of the python test cases starts with a +, which seems to go against the rules that any leading + on a polynomial will be hidden.

  • Custom User Avatar

    Bugs in random tests for Haskell:
    sometimes expected value starts with "--.....", which is clearly wrong.

  • Custom User Avatar

    PHP random tests seem to be off as well.

    For: -12dy+9yzd-9dyz-13y+8y-1-11yd+15yd+9y
    it expects: 4y-8dy-10dyz

    The "1" term should not be there according to the description and the test result makes no sense as a result.

  • Custom User Avatar

    Still some bugs in the random tests of the Haskell version.

    eg 1) expected: "-+14c+11x... due to a ("",-1) term

    eg 2) expected: "z-6ab-9ac... but there was an (uncancelled) ("",1) term present.

    Happily, random test cases are random, so two presses later I had clean green.

  • Custom User Avatar

    Ruby:
    Random Tests return incorrect expected values:

    one example:
    Testing for +7dy+12d-14d
    ✘ It should work for random inputs too - Expected: "26d+7dy", instead got: "-2d+7dy"

  • Custom User Avatar

    I don't understand why the result should be 'x-y'

    In the description, it says that there is no restriction for '-' sign.

    The error I'm facing is:
    '-y+x' should equal 'x-y'

  • Custom User Avatar

    I spent A LOT of time on your kata, even after I solved it... ;-)

    I made a version which can handle coefficients without variables, coefficients greater than 10 and variables with exponents (syntaxes allowed : ** or ^ ; but exponents have to be positives and written without brackets).

    It might be interresting to confront it with others answers. Would like to create a harder version of the kata ?

    It could be interesting to link those two (like SteffenVogel_79 did with his encryption problems : https://www.codewars.com/kata/57814d79a56c88e3e0000786 )

    Thanks for this problem !

  • Custom User Avatar

    Well, me again...
    While checking my code to improve it, I discovered it is actually wrong ! But it passes the tests all the same !

    I suggest you implement some tests with coefficients bigger than 10 (in the previous version of my code, I inverted the strings so 31 becomes 13...)

  • Loading more items...