Ad
  • Custom User Avatar

    Language: C++
    Test suit missing the required headerstd::string.

  • Default User Avatar

    the picture is gone (<img alt="pong" src="http://gifimage.net/wp-content/uploads/2017/08/pong-gif-3.gif">)

  • Default User Avatar

    How is such a mistake even possible:
    Expected: "Player 1 has hit the ball!"
    But was: "Player 2 has hit the ball!"?
    I passed the test task but further...

  • Custom User Avatar
  • Custom User Avatar

    Hi

    I would suggest that the description "Your xp does not reset on a level up. So for instance, if our xp required is 10 and a boar gives 15xp. Then we would level up and also have 5 xp on the next level." be updated as to me it seems like the xp does get reset, else you'd have 15xp after killing that boar and not 5xp!

    I think what you mean to say is excess xp over and above that required to increase a level is carried forward to the next level and not lost?

    Thanks :)

  • Custom User Avatar

    Please take all this with a pinch of salt. This is simply how I would do it if I were making this kata, based on how I think would be easiest for people to read and understand. But it's all up to you. Take it as is, use ideas from it, ignore my suggestions altogether... it's your choice.

    You start at currentLevel, with 0 XP. You need to reach maxLevel.

    To increase your level, you must spend the required amount of XP. This cost starts at requiredXp. When you level up like this, the cost increases by changeInXp.

    To gain that XP you must kill boars. Each time you kill a boar, you gain boarXp.

    I think the main issue with comprehension is the way the arguments are setup. First, it's hard to understand from their names what they refer to. There is no "max level" as such; it just the target you need to reach. Your XP is not changed in any way linked to changeInXp. And what is requiredXp required for?

    (And, just something that rubbed me the wrong way, but "XP" is always all-caps as far as I know. And it doesn't seem to harm readability for those variables to have it all-caps, either.)

    Their order also seems strange. For example, you'll start at a certain level. But that level isn't defined first; it's somewhere in the middle for some reason. So when you explain how things work, you're introducing the variables in one order... then when you're presented with the arguments you'll actually use, it's in a different order--meaning you need to work out yourself which arguments link with which steps in the process.

    I would change the arguments into something like: (currentLevel, maxLevel, levelCost, costIncrease, boarXP) Though it should reflect whatever the explanation is, so it depends on what you settle on.

  • Custom User Avatar

    Speeling errors: "dont", "freelancers", "depending", "dont" again.

    Markup could be improved slightly ( workNeeded, inconsistent minutes case ), and personally, I don't like stringified answers ( they add absolutely nothing in this case. just return a tuple. don't know how well this works for C++ though ).

    Not rating just yet; if nobody comes up with an actual duplicate that issue is moo, otherwise, it should not have been closed just yet.