Beta

What will Agumon digivolve into? (Digimon World 1)

Description
Loading description...
Games
Algorithms
View
AllIssues1QuestionsSuggestions1Show Resolved
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    If one of those is HP, only 1/10th of Agumon's HP is used

    This 1/10 uses integer division too, right? This can lead to different results in very specific edge cases, which should be clarified and (IMO should be) tested. The current edge cases doesn't specifically test for this part.

    • Anon2028 Avatar

      I remember not being able to come up with a test case for this. As far as I can tell, you get the same result with either type of division because of the integer division in the top-level calculation. Consider the following scenario:

      • Calculating score for Tyrannomon (stats are HP + defense)
      • HP is 2999, defense is 150
      • Carryover score is 0
      • Stat count is 2 (HP + defense)
      • Carryover count is 0

      If we divide the HP "wrong", we get:

      ((299.9 + 150) + 0) / (2 + 0) = 449.9 / 2 = 224 /* 224.95 rounded down */

      If we divide the HP "right", we get:

      ((299 + 150) + 0) / (2 + 0) = 449 / 2 = 224 /* 224.5 rounded down */

      If there were another decimal in the calculation, we could get a different result, but:

      • HP is the only stat that gets divided by 10 (MP exists in the game and gets the same treatment, but none of Agumon's digivolutions need it).
      • All the other values in the calculation (non-HP stats, stat count, carryover score and count) are integers.

      Anything I'm missing?

  • ThomasCampbell1988 Avatar

    Enjoyed this kata.

    Test cases looks really well done, with fixed, boundary and randomised tests.

    Took me a while to understand the requirements, and initially I thought there was not enough information in the description to solve the kata.

    However I just had to read through it carefully to piece together the algorithm.

    Perhaps the description could be improved to work through an example of calcuating the full score for an individual candidate champion? But perhaps understanding the requirements is just an intrisic part of the difficulty for this kata.

    I think difficultly wise I'd go for 4kyu based on "Understanding intricate business requirements".