Ad
  • Custom User Avatar

    What was it, please say it :)

  • Custom User Avatar

    Done.

  • Custom User Avatar

    Yes, you are correct. My intention in the first place was to force lazy people to use proper error handling, instead of only error, which is bad style almost always. ;)

  • Custom User Avatar

    mtthw123, after typing that bit a few times, and feeling like it was giving too much away, I ended up adding a couple more example test cases, one in which the vectors were not same-length, then mention that it holds a clue to the correct solution (or a correct solution).

    (= (vector-affinity [6 6 6 6 6 6] [6]) (float (/ 1 6))

    Just since here obviously the second vector is shorter, and the equality to (float (/ 1 6)) illustrates that the larger of the two is used as the denominator.

    What are you thoughts on that?

  • Custom User Avatar

    I hadn't thought of that, but it makes perfect sense. I'll update the description with that. Thanks!

  • Custom User Avatar

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

  • Custom User Avatar

    Added. Thanks, both of you!

  • Custom User Avatar

    And while we're at it, lets check arbitrary strings

    property $ \xs -> parses xs `shouldBe` solution xs
    where solution xs = -- ...
    
  • Default User Avatar

    I struggled a lot with this whilst trying to edit the code but I thought I had ironed it all out.

    It should be fixed now? This is a problem with the editor, automatic indentation and tabbing insert different characters.