Coding Challenge: Create a Character Inventory Class

Let's extend the Character class with new functionalities.

We'll cover the following

Problem statement

Improve the example RPG to add character inventory management according to the following rules:

  • A character’s inventory contains gold(s) and key(s).
  • Each character begins with 1010 gold and 11 key.
  • The character description must show the inventory state.
  • When a character slays another character, the victim’s inventory goes to its vanquisher.

Coding exercise

Get hands-on with 1200+ tech skills courses.