I am just learning how to program, and am using this book to learn some good practices for game programing. Loving this book by the way. However I have a question about the code examples in the book.
Are they complete?
I was reading in chapter 3 about the Random Number Generator, and It seems like the example is not complete. It is clearly stated that it is a implementation of the mersenne twister pseudo random number generator, however, here is what is found in the book:
class CRandom {
// DATA
unsigned int rseed;
unsigned long mt[CMATH_N]; /* the array for the state vector */
int mti; /* mti==N+1 means mt[N] is not initialized */
// FUNCTIONS
public:
CRandom(void);
unsigned int Random( unsigned int n );
void SetRandomSeed(unsigned int n);
unsigned int GetRandomSeed(void);
void Randomize(void);
};
This is all there is though... and it seems incomplete. I may be missing something... I did find the google code project with the full version, but is this how every example in the book is going to be? Are they all incomplete examples that I need to look up in the source code, or are they complete in most cases, and this is an exception, not a rule. Thanks for anyone who can clarify for me.
Are they complete?
I was reading in chapter 3 about the Random Number Generator, and It seems like the example is not complete. It is clearly stated that it is a implementation of the mersenne twister pseudo random number generator, however, here is what is found in the book:
class CRandom {
// DATA
unsigned int rseed;
unsigned long mt[CMATH_N]; /* the array for the state vector */
int mti; /* mti==N+1 means mt[N] is not initialized */
// FUNCTIONS
public:
CRandom(void);
unsigned int Random( unsigned int n );
void SetRandomSeed(unsigned int n);
unsigned int GetRandomSeed(void);
void Randomize(void);
};
This is all there is though... and it seems incomplete. I may be missing something... I did find the google code project with the full version, but is this how every example in the book is going to be? Are they all incomplete examples that I need to look up in the source code, or are they complete in most cases, and this is an exception, not a rule. Thanks for anyone who can clarify for me.
Birdemic