Ad
  • Custom User Avatar

    I don't see any description in the details. Are we supposed to reverse engineer the task from the tests? Love this series, but not sure why the description in this one doesn't describe the kata.

  • Custom User Avatar

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

  • Custom User Avatar

    There are several bugs that could get past your current set of tests:

    Exponential level up:
    if you immediately did the highest level challenge you would get 2250 progress points.
    I see solutions that don't check if the level returned would be past the maximum.
    This test would address it

    	user = User()
    do_test(8, 8, 0)
    

    Slow level up:
    You don't test to see if you are at progress 97..99 and do a same rank that you get to the next level.
    You don't test to see if you are at progress 99 and do a 1 lower rank that you get to the next level.
    I had some buggy code that got past all your acceptance tests. The following tests would check this.

    	user = User()
    do_test(-5, -8, 90)
    do_test(-8, -8, 93)
    do_test(-8, -8, 96)
    do_test(-8, -8, 99)
    do_test(-8, -7, 2)
    
    user = User()
    do_test(-4, -7, 60)
    do_test(-6, -7, 70)
    do_test(-6, -7, 80)
    do_test(-6, -7, 90)
    do_test(-7, -7, 93)
    do_test(-7, -7, 96)
    do_test(-7, -7, 99)
    do_test(-8, -6, 0)