• 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

    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

    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

    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...)

  • Custom User Avatar

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

  • Custom User Avatar

    Good kata, just a few spelling and grammatical issues. The title should be "Simplifying multilinear polynomials".
    There are also a few grammatical issues in the description that I can point out, if you'd like.

  • Custom User Avatar

    Yep, as your description says that was more difficult than expected.

    Have you considered the following scenarios in your tests?

    • constants, e.g. simplify('7-3x+4') -> 3-3x
    • non-simplified factors, e.g. simplify('3c4a2b') -> 24abc