Questions and Answers

Q: Why are Table and Wheel part of the constructor while Player is given as part of the cycle method?
Q: Why do we have to include the odds with the Outcome? This pairing makes it difficult to create an Outcome from scratch.
Q:

Why are Table and Wheel part of the constructor while Player is given as part of the cycle method?

A:

We are making a subtle distinction between the casino table game (a Roulette table, wheel, plus casino staff to support it) and having a player step up to the table and play the game. The game exists without any particular player. By setting up our classes to parallel the physical entities, we give ourselves the flexibility to have multiple players without a significant rewrite. We allow ourselves to support multiple concurrent players or multiple simulations each using a different player object.

Also, as we look forward to the structure of the future simulation, we note that the game objects are largely fixed, but there will be a parade of variations on the player. We would like a main program that simplifies inserting a new player subclass with minimal disruption.

Q:

Why do we have to include the odds with the Outcome? This pairing makes it difficult to create an Outcome from scratch.

A:

The odds are an essential ingredient in the Outcome. It turns out that we want a short-hand name for each Outcome. We have three ways to provide a short name.

  • A variable name. Since each variable is owned by a specific class instance, we need to allocate this to some class. The Wheel or the BinBuilder make the most sense for owning this variable.

  • A key in a mapping. In this case, we need to allocate the mapping to some class. Again, the Wheel or BinBuilder make the most sense for owning the mapping.

  • A method which returns the Outcome. The method can use a fixed variable or can get a value from a mapping.