Ad
  • Default User Avatar

    Glad you enjoyed. I'll be interested to see how people solve it. Can you paste the exact error your are getting from the quick check? In the example mentioned above the ring size would be 1 because no one is spying on each other.

  • Default User Avatar

    Thanks for taking a look at this one. I have updated the test cases so that - I beleive- you will receive a counter examples in case of failure. The random test case code snippet is:

    it "check a random case" $property $
        \x -> largestspyring x === solution (x :: [(Int,[Int])])
    

    This is my first Kata and I am not an expert on hTest, so I'd welcome improvement suggestions.

  • Custom User Avatar

    As for me - but I could be wrong - I think there is some confusion between percent and percentage; percent is the numerator of a fraction the denominator of which is 100 but it is only the numerator. 2 percent is 2 which means for the calculation in the body of a function a percentage of 2/100 = 0.02.

  • Default User Avatar

    It's more typical for a percent-type argument to already be divided by 100.

  • Custom User Avatar

    I am astonished that you don't know that 2 percent is 0.02:-)

  • Custom User Avatar

    Yea this stumped me for a while too...they way the 'percent' value is communicated in the description and examples is a bit unclear. The test case gives a clue as to what is meant by the value '5', but if you didn't have access to that info you wouldn't know what was going on

  • Custom User Avatar

    I was also confused by the 2 / 0.02 used in the example.
    Perhaps it would be better to show it explicitly as 2/100

  • Custom User Avatar

    The description uses 2 percent and the example-calculation uses 0.02 because the parameter percent is ... * per cent* so 2 percent is 2/100 = 0.02. 5.0 percent in the first test case must be transformed by you in your program (and you did it!) in percent / 100 to make the calculation. I really don't understand where you see a problem:-(