example in text format if a condition is met
Code:
#include <iostream>
using namepace std;
int main()
{
int potion = 0; // define and initalize your items
int sword = 0;
sword++; // increment them
potion++;
// display a message
if ( potion >= 1 )
{
cout << "I have a potion" << endl;
}
if ( sword >= 1 )
{
cout << "I have a sword" << endl;
}
return 0;
}
number list option
Code:
// assume you have the required amounts....
int potion = 1;
int sword = 1;
cout << "Sword: " << sword << endl;
cout << "Potion: " << potion << endl;
the above is a snippet, but you get the idea. Also avoid using GLOBAL variables. Use a class like the example below and send the information via a function
Code:
class Inven
{
public:
Inven(); // constructor to implelent the variables
private: // use private for vairable names
int health;
int potions;
string myName;
};