Ad
  • Default User Avatar

    God i love haskell

  • Custom User Avatar

    this is smart... amazing

  • Default User Avatar

    Если честно, я совсем ничего не понял. Ну, да ладно может со временем разберусь.

  • Custom User Avatar

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

  • Default User Avatar

    Didn't get what this &-operator was doing. Can someone explain this to me?
    upd Got it

  • Default User Avatar

    Ah, I misread the instrucions - I read the above ans 0->1->4->0 so a ring of 3!

  • 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

    It's showing a test case when it fails - eg [(0,[1]), (4,[0]), (1,[4])] ... 3 /= 1. Intuitively the solution is 3 and if I type the case into the eaxample tests it passes with 3. But I'm always getting a random failure with a spy ring of 3. Perhaps I'm missing something? Just to add, it could well be a problem with my solution - it took me a lot longer to solve than expected which makes it an interesting kata.

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

  • Default User Avatar

    This is a nice kata. Could 'Attempt' return more information such as input and expected output for failed cases? Currently I get 'fails ater n tests and m shrinks' and an input. When I manually type the input and deduced answer into the examples it always passes so I don't know where/why it's failing. Cheers

  • 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

    Is it valid to have a non-integer population total at the end of a year?

    Should nb_year(10, 1, 0, 11) be 10 or Infinite?

  • Loading more items...