Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int UHP[100]; // Users Hit points
int UATK = rand()%10; // Users Attack points
int UDFC = rand()%10; // Users Defence points
int UACC = rand()%10; // Users Accuracy points
int CHP[100]; // Challengers Hit points
int CATK = rand()%10; // Challengers Attack points
int CDFC = rand()%10; // Challengers Defence points
int CACC = rand()%10; // Challengers Accurasy points
cout<<"As your walking down a path a cloaked swordsman ambushes you.\n";
cout<<"He then challenges you to a fight and you humbly accept.\n";
cin.get();
}
Heres what I was thinking when you type in attack it will see if you hit by ( UACC <= 6 ) if it is then you hit if not you miss. afterwards the challenger would get to use defence if their ( CACC <= 6 ) if not the dont get to defend and it would take the random number generated from UATK and subtract it from CHP. but i cant figure out how you would make it so it would keep it subtracted and not just reset back to 100