6 kyu

The Dice Game

Description
Loading description...
Algorithms
Games
  • Please sign in or sign up to leave a comment.
  • Nkotiya Avatar

    Проблема! Как можно на основании такого счета [(5, 1), (2, 6), (1, 6), (6, 4), (3, 4), (2, 5), (6, 1), (3, 2), (4, 1)] определить победителя 'p4'? Если после первого раунда: 5+1=6, 2+6=8, 1+6=7, 6+4=10 выбывает 'p1' с минимальным результатом: 5+1=6, то во втором раунде оставшиеся 3 игрока выкидывают одинаковый результат: 3+4=7, 2+5=7, 6+1=7.Ничья. По правилам игроки перебрасывают кубики, значит в общем счете должно быть зафиксировано еще как минимум 3 результата для определения победителя, а имеем только 2 результата: 3+2=5, 4+1=5. Как при таком счете определить победителя? Алгоритм который я создал прошел все тесты кроме этого. Кто-нибудь сможет мне объяснить как это понимать?

  • SupernovaIa Avatar

    hard and fun to code, but this is above 5kuy, i'd say 4 kyu

    • saudiGuy Avatar

      Difficulty ranks cannot be changed, and it’s not a 4kyu kata, not even 5kyu.

      Suggestion marked resolved by saudiGuy 6 months ago
    • SupernovaIa Avatar

      I know it cannot be changed. I was sharing my feelings about the kata based on the fact that all 5kyu katas i've solved were easier than this and for sure 6kyu even easier.

      Obviously that's my point of view and it's possible that i struggled with coming up with the algorithm this time.

      Thanks for your thoughts

    • saudiGuy Avatar

      Don't use the 'suggestion' tag for this 'feeling'. :)

    • SupernovaIa Avatar

      Understood :)

  • ahmet_popaj Avatar

    Quite a little bit tricky figuring out the right method and procedure to solve this kata.

  • Jolinator Avatar

    I think this is way harder than 6 kyu, feels like a 4 kyu. Good kata, not as simple as it seems.

  • uHirsch Avatar

    This comment has been hidden.

  • gndnls Avatar

    how does p4 win this dice_game([(1, 3), (2, 6), (6, 3), (5, 6), (2, 2), (5, 6), (5, 4), (1, 3), (5, 6)]), 'p4')

    p4 has a value of 11 and player1 and player8 have the same value, and the tiebreaker doesnt work there ...

  • hobovsky Avatar

    I don't understand this part:

    In such cases, we introduce a tiebreaker: the player among them with the lowest score from their first dice roll gets the boot.

    But in the example, there is the round 3 where p1 and p4 roll (1, 5), which is a tie. Tie breaking rule says that their first roll should be checked, and for p1 it's (6, 2) and for p4 it's (5, 4). But in the example, the tie not resolved and players proceed to round 4. Why?

    • hobovsky Avatar

      It was explained to me that the tie breaker should be read as "the first die of a current roll", but this is confusing: the players roll a pair of dice, and there is no first die nor a second die when you roll a pair of dice.

    • hobovsky Avatar

      The "all players should go for another round of rolls" adds to the confusion, because, trying to find a way through the first confusing situation, it was not clear anymore if "all" means all participants, or just remaining, active players.

    • akar-0 Avatar

      I agree with your remarks. I beg the author to clarify this or I believe it should be raised as un issue.

  • mauro-1 Avatar

    It should be clearer that in case of tie all players repeat the round, not only the players with the lowest score.

    P.S. It would be more interesting if only the players with the lowest score repeat the roll until one of them gains the elimination.

  • ejini战神 Avatar
    • Description should be language-agnostic (Removal of function name)

    • Missing useful assertion messages

  • Voile Avatar

    The input seems very dangerous. What happens if scores are exhausted and no winner has been declared yet? Or will this never happen?