#include <iostream> #include <windows.h> #include <stdlib.h> #include <time.h> using namespace std; struct player_stats { char name[25]; int age; short str; short wis; short con; } player; int statGen(int stat) { srand ( (unsigned)time( NULL ) ); stat = rand(); } int genChar(bool gender) { if (gender == 1) { player.age = statGen(0); player.str = statGen(0) - 4; player.wis = statGen(0) + 4; player.con = statGen(0); } else { player.age = statGen(0); player.str = statGen(0) + 4; player.wis = statGen(0) - 4; player.con = statGen(0); } cout << "Your are " << player.age << " years old!\n"; cout << "Your have " << player.str << " strength!\n"; cout << "Your have " << player.wis << " wisdom!\n"; cout << "Your have " << player.con << " constitution!\n"; } int main(int argc, char *argv[]) { genChar(1); system("PAUSE"); return 0; }