Challenge
No
You're a dungeon master. Write a program to compute the XP awarded to players for monsters they've killed. Include this code exactly:
- kali_score = compute_xp(4, 1, 5)
- vijay_score = compute_xp(3, 1, 4)
- mary_beth_score = compute_xp(2, 4, 3)
The first param is the number of orcs killed. They're worth 10 points each.
The second param is the number of goblins killed. They're worth 20 points each.
The third param is the number of giant rats killed. They're worth 7 points each.
If the number of goblins a player kills is at least two more than the number of orcs killed, add 30 XP.
Here's the output your program should produce.
- Encounter XP
- ========= ==
- Kali: 95
- Vijay: 78
- Mary Beth: 151
- Party total: 324
Upload a zip of your project folder. The usual coding standards apply.
If you were logged in as a student, you could submit a solution to this exercise.
Where referenced