#include "ex2.h" #include using namespace std; dice::dice(int s):sides(s),value(-1) { } void dice::roll() { #ifdef __WIN32__ value = random(sides) + 1; #else value = (random() % sides) + 1; // % = MODULUS #endif } int dice::get_value() { return value; }