#include <iostream>
usingnamespace std;
int main()
{
cout <<"Compiles Properly/n";
//Variable Declaration
int Spellcaster;
int Fighter;
int Crafter;
int BaseStrength;
//Variable Assignments
Spellcaster = 1;
Fighter = 2;
BaseStrength >= 0;
if (Spellcaster = 1)
BaseStrength = 10;
elseif (Fighter = 2)
BaseStrength = 20;
return 0;
}
Okay so I have a few questions heh:
#1. I am trying to make it so that when someone picks a spell caster their base strength is 10 but if they pick a Fighter it is 20. Will this work?
#2. Am i using the correct = or should I be using == I am very new so still learning.
#3. When I compile it says it is fine but with no way of me being able to see a spell caster or a fighter I can't tell if it works heh (I know more of a statement than a question).
#4. Will i need to link this to my <base_Player.h>?
#5. Am I practicing good coding with this script? If i am not please tell me how too.
Just to let you guys know I have reading a lot here..very good articles teaching lots of good stuff. Thanks for allowing me in the community.
#include <iostream>
#define SPELLCASTER 1
#define FIGHTER 2
usingnamespace std;
int main()
{
int choice;
int BaseStrength;
cout << "What rase do you want to be?" << endl;
cout << "1. Spell Caster" << endl;
cout << "2. Fighter " << endl;
cout << "Enter you choice here: ";
cin >> choice; //get users input
if(choice==SPELLCASTER) {
BaseStrenght=10;
}
else(choice==FIGHTER) { //use == to check is it is equal... = means assignment
BaseStrenght=20;
}
else BaseStrenght = 0;
cout << "Your strenght is: " << BaseStrenght;
cin.get();
return 0;
}
@2. in if statments .. use the '==' operator... it to checks it is equal.
'=' is to asign a value to a variable.
@3. check 1..
@4. I don't know that <base_Player.h> is ... but I doubt it came with you compiler... so you can't use '<..>' to include it.. if it's a header you created put it in the same folder as the project or main file and include it like this "base_Player.h"
@5. That isn't quite a script ... You should read a little the tutorial on this website cause it will help you a lot