Index: [thread] [date] [subject] [author]
  From: Garrett Mitchener <wgm2@duke.edu>
  To  : 
  Date: 31 Mar 1999 21:44:03 -0500

Re: Number of Sides to the dice

Jason Grosland <jcg3@cs.duke.edu> writes:

> On Sun, 28 Mar 1999, Ted Hung wrote:
> 
> > How many sides are there supposed to be to the dice that we are rolling.
> > Right now, I have the value stored as a value as PigGame.DICE_SIDES.
> > Is this alright.  We did the same thing for the winning score and as
> > PigGame.WINNING_SCORE.
> 
> This is a good idea.  You can assume that the game will be played with a
> six sided dice (die?), and you play to 100.  Using constants like above is
> a good idea-- who knows when you'll be asked to play pig with a 12 sided
> die?
> 
> ...jason

If your dice class requires a constant in class PigGame, you're going
to confuse a lot of people who want to use dice but don't want to play
Pig.  (Your dice class should be reusable, right?)  May I suggest that
you construct the die with the number of sides, and perhaps the game
class has a constant that it always uses.

(By the way, "die" is sigular, "dice" is plural, in case you really
wanted to know.)

	-- Garrett :-)



Index: [thread] [date] [subject] [author]