13-04-2009, 10:08 AM
My first game programmed with C++
No tutorial was followed, just all my knowledge from 17 online lessons
People that do know C++, feedback on the source and what I can do better to improve
my programming skills would be appreciated.
source code: [spoiler][code]#include
#include
void RollDice(int iPlayerGuess);
void GiveGold(int iAmount);
void TakeGold(int iAmount);
void PlayerWin(int iDie1, int iDie2);
int iPlayerGold;
void main() {
int iPlayerGuess;
std::cout iPlayerGuess;
RollDice(iPlayerGuess);
}
void RollDice(int iPlayerGuess) {
time_t t;
time(&t);
srand(t);
int iDie1;
int iDie2;
if (iPlayerGuess < 0 || iPlayerGuess > 12){
main();
}
std::cout
No tutorial was followed, just all my knowledge from 17 online lessons

People that do know C++, feedback on the source and what I can do better to improve
my programming skills would be appreciated.
source code: [spoiler][code]#include
#include
void RollDice(int iPlayerGuess);
void GiveGold(int iAmount);
void TakeGold(int iAmount);
void PlayerWin(int iDie1, int iDie2);
int iPlayerGold;
void main() {
int iPlayerGuess;
std::cout iPlayerGuess;
RollDice(iPlayerGuess);
}
void RollDice(int iPlayerGuess) {
time_t t;
time(&t);
srand(t);
int iDie1;
int iDie2;
if (iPlayerGuess < 0 || iPlayerGuess > 12){
main();
}
std::cout