5 kyu

Build a quadratic equation

308 of 385wowthecoder
Description
Loading description...
Mathematics
Strings
Algebra
Fundamentals
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    consider displaying input value instead of "One random test" for each random test.

  • jkimbell Avatar

    Okay, I'll handle this special case. Okay, I'll handle this other special case. Okay...

  • ejini战神 Avatar
    • Removal of multiples of 0 was not mentioned in the description.

    • Example and sample tests like below should be added

    test.assert_equals(quadratic_builder("(x+0)(x+1)"), "x^2+x")
    test.assert_equals(quadratic_builder("(2q+3)(2q-3)"), "4q^2-9")
    
    • Description also does not mention that m and p will never be 0, also n and q can be 0

    • Description should be language-agnostic (removal of function names)

  • sansmorixz Avatar

    Removal of multiples of 0 was not mentioned in the tasks.

    ie something like 6x^2+0x-1. should become 6x^2-1.

  • marioalre Avatar

    This comment has been hidden.

  • genicor Avatar

    i have the problem with one test case on python i have this answer y^2-5y-66 but it should be 55y^2-599 y-66 i think it's incorrect case because My program in case (𝑦−11)(55𝑦+6) got 55y^2-599 y-66 and in case (y-11)(y+6) got y^2-5y-66 and it is correct Plese check this test case I've complete all test except this one

  • A_Vaclav Avatar

    Traceback (most recent call last): File "tests.py", line 2, in from solution import quadratic_builder File "/workspace/default/solution.py", line 1, in import sympy as sym ModuleNotFoundError: No module named 'sympy'

    Why? My first solution on the 'sympy' module has 23 lines. But getting an error, I decided not to use modules. And my cat became very fat ...

  • Expurple Avatar

    Nice kata! I've submitted a C++ translation

  • RNOH Avatar

    Wow! Love this kata! Very Niceee!!

  • akar-0 Avatar

    Approved :)

  • anter69 Avatar
    • description should mention that if a or b is 1,the 1 has to be omitted;
    • testing is not thorough enough: my solution would return something like x^2+1x+2 (note the 1x), which should not be correct
  • lfhohmann Avatar

    Fun Kata!

  • wowthecoder Avatar

    Thanks @XRFXLP for editing and improving my kata test suite. Finally now I can understand FArekkusu's earlier request about wrapping the referrence solution. Sorry for being rude earlier, but I must say FArekkusu did not explain his requests clearly. And for reading the documentation, I did read it but the docs are very vague on how to handle reference solutions inside the test suite. Anyway thanks for the help and sorry for the inconvenience caused. @FArekkusu it would be better if you can explain clearly what issues you want me to fix the next time, I am still a newbie :)

  • FArekkusu Avatar

    Sample tests are still not in a describe block. Sample tests still don't import the solution. Random tests are still not in a describe block.

    Stop closing issues without fixing anything. You were given a link to the documentation - use it ffs.

  • FArekkusu Avatar

    Sample tests and random tests should use it blocks. The solution should be imported explicitly. The reference solution should be inside a describe or an it block.

  • FArekkusu Avatar

    There're already quite a few katas which require parsing/formatting polynomials, and if you strip this away, the task essentially becomes "add/multiply a bunch of numbers". IMO this is really bad and uninspired.

  • FArekkusu Avatar

    New test framework should be used, and the reference solution should be inside a relevant describe/it block.

  • wowthecoder Avatar

    By the way I already have a java translation, so if you want to make a translation for this please don't make a java translation

  • wowthecoder Avatar

    This is a duplicate of my retired kata "Quadratic Equation Builder" that was automatically retired because of the initial issues. I put in quite a lot of effort in it and I think it would make a great kata, so here I am with with the republished kata. All the issues in the previous kata have been addressed and fixed! Please approve this kata! I would really appreciate it if my kata get pass the beta process. Thanks to everyone that raised issues on my first kata so that I can fix it :)