Ad
  • Custom User Avatar

    the k=0 rule would make sense if the problem was turned into a problem where you have to select the amount of dice with n being the limit
    @_@, but currently for every other output it seems to only care about the sum if u rolled all the dice

  • Custom User Avatar

    These issues [1][2] pointed out that for n = k = 0, the result should be 1.
    However, this did not mean that the result should always be 1 if k = 0, just for the specific case of n = k = 0.
    It is impossible to roll a 0 with a six sided die. outcome(1,6,0) must be 0.

    • there is always exactly 1 case to reach k = 0 regardless of the number of dice you have needs to be removed from the description
    • act(1, 6, 0, 1), act(2, 6, 0, 1), ... need to be removed from the tests
    • The reference solution used in the tests needs to be replaced
    • The behaviour for n = k = 0 should be clarified in the description, like the other issues already stated
  • Custom User Avatar

    Several results make no sense. Like "act(0, 6, 0, 1)": How can you throw zero dices one time? That is physically impossible. You can only reach zero points by not throwing the dices at all, no matter how many you have.
    Or "act(1, 6, 0, 1)": How can you throw one dice with side values of 1-6 and reach zero points? The minimum you can reach with one throw is 1.
    Or "act(0, 6, 1, 0)": You have no dice, but you reach a score of 1 by throwing them zero times? How is that supposed to work?
    Or "act(1, 6, 7, 0)": You can score a maximum of 6 points with a throw, but with zero throws you can score 7 points...?
    My opinion: A target of zero can only be achived with zero throws, no matter how many dices and sides you have. If the target is >0, then there should be >0 dices, otherweise return -1 or "Error". A target larger than the maximum points you can achieve should either be removed or also lead to -1 or "Error".

  • Default User Avatar

    I do not understand the logic here. You do not pick how many dice you can roll, it is n dice. There is no way (0 ways) to have a roll sum of k = 0 when you roll at least one die. This outcome should only be possible when both n and k are 0. If you ask for 1 when k = 0 and n > 0, you implictely say that we get to choose how many dice we can roll, which is a different problem than what the kata is asking for. It also makes the sum of probabilities for each k bigger than 1, which does not make sense.

  • Custom User Avatar

    @dfhwze I think k == 0 is reachable iff n == 0. (Take a look at my solution to the current version.)

  • Custom User Avatar

    fixed

  • Custom User Avatar

    fixed

  • Default User Avatar

    especially when you read it as

    s sides numbered from 1 to 0

  • Default User Avatar

    agreed, is this not unlike a vacuous truth?

  • Custom User Avatar

    I agree that if k = 0, the answer should always be 1, regardless how many dice you have, even if you have 0 dice. What do others think?

  • Custom User Avatar

    I think s = 0 does not make any sense at all. I could just remove cases like this. What do you think?

  • Custom User Avatar

    fixed

  • Custom User Avatar

    Duplicate issue.

  • Default User Avatar

    python: outcome(0, 9, 0): 1 should equal 0

    There is one way of rolling the dice 0 times such that the sum is 0, that is to not roll the dice.

    This is the same reason why 0! = 1

  • Custom User Avatar

    outcome(0, 8, 0) is expected to equal 0, not 1, which is confusing since summing up zero 8-sided dice will always result in a sum of zero (by the usual convention that the empty sum is zero). The intended behavior for n == 0 should be clarified in the description.

  • Loading more items...