1. Virtual Laboratories
  2. Object Library
  3. Devices
  4. Die

Die

Description

This class models a standard, 6-sided die with specified colors and probabilities. The class has methods for getting and setting the colors, the probabilities that govern the faces, and the value. The class also has a method for "rolling" the die, to generate a random value governed by the probabilities. This object is used, for example, in the die-coin experiment.

A medium sized red die A large green die A small blue die

Class Hierarchy

Code

The text area below gives the code for this object, so that you can browse the constructors, methods, and properties of the object. Of course, this source file is part of devices.zip, which contains all source and resource files for the objects in the devices package.