Well, but you don't have to have a physical die to emulate. If you want to roll a d6 until you don't get a 6, just roll a d5. (I would still just use a malloc'ed array, rather than a linked list.)
Type: Posts; User: tabstop
Well, but you don't have to have a physical die to emulate. If you want to roll a d6 until you don't get a 6, just roll a d5. (I would still just use a malloc'ed array, rather than a linked list.)
I can only suggest ideas; without knowing the different ways you're using dice, I can't say how applicable they are.
With that caveat: many different sizes of dice is no problem with the above...
An idea, for good or ill:
class Die {
public:
int Roll();
Die(std::vector<int> possible_sides);
private:
int number_of_sides;
std::vector<int> sides;