What is wrong with this code?
What is wrong with this code? I'm probably too tired to notice it right now, it's 2 am and I'm nearly blacking out. I wanted to practice c++ cuz i suck so i started to make this little game thingy, but now im sooo tired. Can somebody fix it pl@wkz while I sl33pz0r?
Code:
#include <iostream.h>
#include <fstream.h>
int myhp;
int mysp;
int mydmg;
int ohp;
int osp;
int odmg;
int input; int turns;
void turn()
{myhp+25;mysp++;ohp+25;osp++;turns++;
if ( mysp >= 5 && mysp <= 10 ) {mydmg + 7; } // determining
if ( mysp >= 11 && mysp <= 20) {mydmg + 12;} // your
if ( mysp >= 21 && mysp <= 30) {mydmg + 15;} // damage
if ( osp >= 5 && osp <= 10 ) {odmg + 5;} // determining
if ( osp >= 11 && osp <= 20) {odmg + 7;} // opponent
if ( osp >= 21 && osp <= 30) {odmg + 9;} // damage
myhp - odmg;
ohp - mydmg;
return;
}
int main()
{
cout <<"Hello Player."<<endl;
cout <<" The Game Begins. "<<endl;
int myhp = 100; //initial values
int mysp = 0; //
int mydmg = 17; //
int ohp = 100; //
int osp = 0; //
int odmg = 15; //initial values
while (1){cout <<"Enter 1 to start a turn";cin >> input;
if ( input = 1 ){turn();}
if ( input != 1){break;}
cout<<myhp<<endl;cout<<mydmg<<endl;cout<<ohp<<endl;cout<<odmg<<endl;
if(myhp<ohp){cout<<"You Lose";getchar();break;}
if(ohp<myhp){cout<<"You Win";getchar();break;}
if(turns>40){break;}
}
cout <<"End of Program."<<endl;
getchar();
return 0;
}


