Beta

Dungeons And Dragons 5th edition leveling utilities

Description:

In the role playing game Dungeons and Dragons 5th edition, you play characters adventure and gain levels.

The system provides a number in experience points required to reach a certain level. The required levels are given as a map:

:1 0 :2 300 :3 900 :4 2700 :5 6500 :6 14000 :7 23000 :8 34000 :9 48000 :10 64000 :11 85000 :12 100000 :13 120000 :14 140000 :15 165000 :16 195000 :17 225000 :18 265000 :19 305000 :20 355000

Code three functions:

  1. Determine the current level of the character based on its current experience points.
  2. Determine the next level of a character based on its current experience points.
  3. Determine the experience left to advance to the next level.

Why three functions? You might see some synergy between the first two methods and the last one. These are all valid points you might be asking as a player.

Special rules:

  1. The level should be returned as a keyword, so we can match it against the level requirement map if needed.
  2. Level 20 is a special case. Once you reach this max level, your experience until next level should return 0. And your next level should return the max level.

Tips: The level requirements map is not ordered, maybe you might want it to be?

Happy coding! ^_^ Enjoy my first kata.

Games
Puzzles

Stats:

CreatedSep 13, 2017
PublishedSep 14, 2017
Warriors Trained41
Total Skips1
Total Code Submissions49
Total Times Completed8
Clojure Completions8
Total Stars1
% of votes with a positive feedback rating100% of 6
Total "Very Satisfied" Votes6
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes0
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Nightpanda Avatar
Ad