Ad
  • Custom User Avatar

    Before these two tests:

      Test.assertDeepEquals(Goku.battle(9), "An intense fight", "Your warrior picked a fight with a relatively strong enemy. Nothing he can't hold his/er own to. Provide the appropiate response")
        Test.assertDeepEquals(Goku.battle(14), "You've been defeated", "Your warrior picked a fight he/she can't win.")
    

    The warrior level is actually should be 4, not 3 as seen in the tests below.

        // Before
        Test.assertDeepEquals(Goku.level(), 4, "Your warrior should now be LV 4")
        Test.assertDeepEquals(Goku.experience(), 400, "Your warrior's experience should be relative to his level")
        // Now
        Test.assertDeepEquals(Goku.battle(9), "An intense fight", "Your warrior picked a fight with a relatively strong enemy. Nothing he can't hold his/er own to. Provide the appropiate response")
        Test.assertDeepEquals(Goku.battle(14), "You've been defeated", "Your warrior picked a fight he/she can't win.")
    

    With the current total experience of 400. So, gained exp is 20 * (9-4) * (9-4) = 20 * 25 which is 500. So, the new level should be 9 (because 400 + 500).

    The warrior is 5 level from 14 and is lower in rank (the warrior is Pushover, meanwhile the enemy is Novice).