Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
God i love haskell
this is smart... amazing
Если честно, я совсем ничего не понял. Ну, да ладно может со временем разберусь.
This comment is hidden because it contains spoiler information about the solution
Didn't get what this &-operator was doing. Can someone explain this to me?
upd Got it
Ah, I misread the instrucions - I read the above ans 0->1->4->0 so a ring of 3!
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.
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.
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:
This is my first Kata and I am not an expert on hTest, so I'd welcome improvement suggestions.
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
As for me - but I could be wrong - I think there is some confusion between
percent
andpercentage
; percent is the numerator of a fraction the denominator of which is 100 but it is only the numerator.2
percent is2
which means for the calculation in the body of a function a percentage of2/100 = 0.02
.It's more typical for a percent-type argument to already be divided by 100.
I am astonished that you don't know that
2 percent
is0.02
:-)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
Is it valid to have a non-integer population total at the end of a year?
Should
nb_year(10, 1, 0, 11)
be10
orInfinite
?Loading more items...