Ad
  • Default User Avatar

    In your Sample Tests, I cannot see that you've instantiated the class User:
    User user = new User();
    See if this helps.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You should become a mender, @benjaminzwhite.

  • Default User Avatar

    Hi again; congratulations on solving, and thank you for returning to your issue and closing it yourself.

    In general I agree that debugging these kind of OOP katas can be difficult - since you are new to the site, you may find this Troubleshooting doc useful - it contains some advice on how to solve common issues (if test results were confusing, as you mentioned, you can print a lot of stuff to console to make debugging easier).

    It seems then that the problem you had in the end was related to this expected behavior:

    • Any remaining progress earned while in the previous rank will be applied towards the next rank's progress (we don't throw any progress away). The exception is if there is no other rank left to progress towards (Once you reach rank 8 there is no more progression).

    I agree that it can be easy to miss such small conditions, especially when kata is complex with large description, but that's why they are ranked as more difficult (and good practice for "real world" projects), so you are expected to debug a bit when solving.

  • Default User Avatar
  • Default User Avatar

    Solved the issue. I read the test results wrong.
    The description needs to say clearer what happens when rank 8 is reached. Of course you don't add it to the next rank, do you just store the value then? Don't minus 100? NO!! you set it to ZERO!! What a waste of time trying to solve this test!!

  • Default User Avatar

    Hi Thanks for your feedback, noted. Yes I'm using C#. I'm aware there is no zero rank. I'm talking about where the activity rank is LOWER than the user. So the progress is either the same or +1, depending on the delta. To calculate the delta, is zero also ignored? So rank = -1, activity = 1 => is the delta 1 or 0? Or am I missing something else.

  • Default User Avatar

    Hi - in general, please don't use issue tag for problems with your code; it is reserved for problems with the kata itself.

    It seems you are using C# ? I won't close Issue as I can't see your code, but the kata has been solved 700+ times in that language so it's unlikely to be a problem with the kata.

    As for your problem - are you implementing these conditions succesfully?

    • There is no 0 (zero) rank. The next rank after -1 is 1.

    • (from the Logic Examples part of the description) If a user ranked -1 completes an activity ranked 1 they will receive 10 progress (remember, zero rank is ignored)

  • Default User Avatar

    I can't pass the test where rank = -1 and activity rank = 1.
    If progress is worth 1 point => it passes one test, and fails another.
    If progress is worth 0 point => it fails one and passes the other. Please help! Thanks

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I believe the input you are referring to is:

    [-23, 4, -5, 99, -27, 329, -2, 7, -921]

    which has expected answer: -14, is that the one you mean?

    The reason for this answer is because of the description: "... by multiplying 2 adjacent numbers..."

    You cannot form, for example 99 * 329 from the above array, because 99 is not adjacent to 329.

  • Default User Avatar

    In a test where there is a mixture of positive and negative numbers, the expected number is -14. I do not agree because there are two negative numbers, when multipled, is a positive number which is a lot bigger than -14.