Hello I've been on C++ for a day :O and I've started somthing for some fun
a texted based game called TextScape! but I'm having some problems with the functions can somone please run through it for me?
#include <iostream>
#include <string>
using namespace std;
// Declaring Variables
int Command;
int Gender;
string GenderO;
int Race;
string RaceO;
int Prof;
string ProfO;
int PLH;
int PLD;
int PLA;
int MOH;
int MOA;
int MOD;
int Attack (int PLH, int PLD, int PLA, int MOH, int MOD, int MOA)
{
int DMG;
int Boost;
int A;
int B;
if (MOH > PLH) Boost = (PLH - MOH);
else
{
A = MOH / PLH * 10^2;
B = A - A - A;
Boost = B;
}
DMG = PLA - MOA + Boost;
}
int main ()
{
cout << "Welcome to Textscape!\n\n";
cout << "Textscape is still in Develoupment stage\nPlease send all bug to joshhua123@hotmail.com";
cout << "\nWould you like to be Male or Female.\n Type HelpSex for information on genders.\n Male = 1, Female = 0\n";
cin >> Gender;
cout << "You've Selected " << GenderO << " What Race would you like?, type HelpRace for information on Races.\n Human = 1, Dwarf = 2, Elf = 3, Orc = 4\n";
cin >> Race;
cout << "You've Selected " << RaceO << " What Profeshion will you follow?, Type HelpProf for information on Profrshions.\nBerserker = 1, Mage = 2, Archer = 3, Defender = 4\n";
cin >> Prof;
cout << "You are a " << GenderO << " " << RaceO << "that uses " << ProfO << " to destroy what ever's in it's path.";
// Charater process
PlayerRace ();
PlayerSex ();
PlayerProf ();
// end charater proccess continue with code.
cout << "Time for your first choice. Do you wan't to Attack, Check stats or Visit the store?\n";
cout << "Attack : Fight a random moster in a Kill or be killed situation.\n";
cout << "Shop : Visit a Show to upgrade or heal.\n";
cout << "States : Check current Chariter status.\n";
cin >> Command;
}
Mazd is right. make your functions void. main should be int and return 0.
Another problem is with your strings. For example, string RaceO = "Human"; is wrong. It declares a new local variable RaceO, while there is a global one (the one you really need). Change it (and other similar lines) to RaceO = "Human";