#ifndef DICETOWER_H #define DICETOWER_H #include #include using namespace std; class diceTower { public: // Constructor: Default seed to time diceTower (){ srand(time(NULL)); } // Constructor: Seed to parameter diceTower ( unsigned int seed ){ srand( seed ); } // roll a d-sided dice int d ( unsigned int sides ){ int r = rand(); return ( r % sides ) + 1; } // get a random number in [min..max) int getRandom(int min, int max){ int span = max - min; if ( span == 0 ) return min; int r = rand(); return ( r % span ) + min; } }; #endif