Design

PlayerRandom is a Player who places bets in Roulette. This player makes random bets around the layout.

Fields

  • Java: java.util.Random rng ;

    Python: rng  

    Generates the next random number.

Constructors

  • PlayerRandom(Table aTable,
                 Random aGenerator);

    This uses the super construct to invoke the superclass constructor using the Table. Then it saves the random number generator. This could be an instance of either Random or NonRandom.

    For those new to Java, see Java Subclass Constructors. For those new to Python, see Python Subclass Constructors.

Methods

  • void placeBets();

    Updates the Table with a randomly placed bet.