Beta

Computational Geometry #1: Mixing Paints

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    The kata needs to specify len(paints), because this is relevant to the runtime complexity of the solutions too.

    • ALowVerus Avatar

      Per the description:

      Test constraints:
      
      30 sets of random source paints will be tested.
      Each source paint will have an R value and a G value ranging from 0 to 1.
      Each set of paints will contain up to 10 unique paints. (I create 10, then dedupe.)
      Each set of paints will be tested by sampling a 40x40 grid. i.e. the point (0,0) will be tested, then (0,0.25), then (0,0.5) etc, up to (0,0.975), at which point the test will roll over to (0.25,0). Your solution should be able to handle these 48000 validate queries rather quickly - my solution gets them in around 1-2 seconds.
      
      Issue marked resolved by ALowVerus 17 months ago
  • Kacarott Avatar

    Reraising issue from below:

    • Should use latest testing framework
    • Full tests produce far too much output (fills up the buffer) for incorrect solutions
  • Kacarott Avatar
    • Should use latest testing framework
    • It would be great to get a few more sample tests, with slightly more complex expected results. I pass the current sample tests easily, but I do not pass a single random test. Running the full tests produces so much output that it slows my (old) machine down considerably, so it is frustrating to be forced to run this constantly.
    • ALowVerus Avatar
      • Could you please link to docs on the new testing framework? I'm unfamiliar with new CodeWars updates.
      • Strings only get output if tests fail. If your solution actually works, no output is generated, so no issue. If you solution doesn't work, better to have slow tests that describe your failure than fast tests that tell you nothing.
    • ALowVerus Avatar

      Bump.

      Issue marked resolved by ALowVerus 4 years ago
    • Kacarott Avatar

      Here you go

      better to have slow tests that describe your failure than fast tests that tell you nothing

      This is exactly my point though. Why not provide a few more sample tests that are more complex than the current sample tests? Then users can get tests that describe the failure, without requiring the webpage to freeze for 45 seconds every time? Just saying "if your solution is correct then it works" does not mean there is no problem. (Is there really such a need to run over 5000 tests and to output results for each one?)

      Also please do not close issues without resolving anything.

  • user9644768 Avatar

    Desired paint mixture is (0.0, 0.0), but the given ratios, {((0.4553, 0.0202), 0), ((0.618, 0.0734), 0.0), ((0.2345, 0.4286), -0.0), ((0.6506, 0.7601), 0), ((0.9636, 0.1713), 0), ((0.1642, 0.0801), 0), ((0.4372, 0.3254), 0), ((0.7579, 0.7544), 0), ((0.0951, 0.6714), 0), ((0.4268, 0.8019), 0)}, resolve to (0.0, 0.0), with a total fractional value of 0.0.

    Is there something "fractional value" that I've to consider? Because my color mixture actually resolves to the desired mixture.

    • ALowVerus Avatar

      If I gave you green and red paint, you couldn't create black paint through the absence of green paint, by just adding 0 green paint. Any ratio of my green and red paint, be it 0.1:0.9, or 0.5:0.5, or any other mixture, must have a total content that adds up to 1.0 total paint fractions

      In other words, you are currently trying 5o create (0,0), i.e. black paint, by denying the existence of the paints you have on hand, like (0.6506, 0.7601). If you put 0 of every paint into a pot, you dont have black paint, you have air.

    • user9644768 Avatar

      This comment has been hidden.

    • user9644768 Avatar
      Question marked resolved by user9644768 5 years ago
  • dramforever Avatar

    This comment has been hidden.

  • FArekkusu Avatar

    This comment has been hidden.