What did I do wrong

Can some one please tell me why this wont work i have tried everything!(Also im a beginner to c++ and I wrote this program with Dev-c++)



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include<iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

class Enemyclass{
	public:
		 Monster(){
		 	
			srand(static_cast<unsigned int>(time(0)));  

	int randomNumber = rand();

	int die = (randomNumber % 10) + 6;
			int attack;
			int magic;
			int choice;
			int A;
			int B;
			cout<<"I will destroy YOU!!!!"<<endl;
			cout<<"Press A to attack"<<endl;
			cout<<"Press B to use magic"<<endl;
			cin>> choice;
			
			if(choice= A){
			
			cout<<"You attack and do "<<die<<" damage"<<endl;}
			
			if(choice=B){
			
			cout<<"your magic does "<<die<<" damage."<<endl;}
		}
};

int main()
{
   
  
    	
    cout<<"You encounter a monster"<<endl;
    Enemyclass monsterObject;
	monsterObject.Monster();
	return 0;
  
}
Topic archived. No new replies allowed.