Class MontyHallGame

  extended by edu.ucla.stat.SOCR.core.SOCRValueSettable
      extended by edu.ucla.stat.SOCR.core.MultiplePartsPanel
          extended by edu.ucla.stat.SOCR.core.Game
              extended by
All Implemented Interfaces:
IGame, IValueSettable, Pluginable, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, java.util.Observer

public class MontyHallGame
extends Game
implements java.awt.event.ItemListener

This class models the famous Monty Hall game. A diamond is behind one door, jockers are behind the other two. The player first chooses a door. Then the host opens a different door. The player can stay with her original choice or switch to the remaining door.

Nested Class Summary
Nested classes/interfaces inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
Field Summary
static int BLIND
static int STANDARD
Fields inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
applet, fName, graphs, mainPane, recordTable, tables, toolbar, toolbar2, toolbars
Constructor Summary
          This method initializes the game, including the toolbar buttons, doors, images
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This method handles the events for the Play button
 void itemStateChanged(java.awt.event.ItemEvent event)
          This method handles the events for the host choice
 void mouseClicked(java.awt.event.MouseEvent event)
          This method handles events for the door clicks
 void reset()
          This message resets the game
Methods inherited from class edu.ucla.stat.SOCR.core.Game
getAppletInfo, getDisplayPane, getInstance, getOnlineDescription, performAction, setAppletInfo, updateGame
Methods inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
addGraph, addTable, addTool, addTool2, addToolbar, format, getMainPanel, getName, getRecordTable, getTextPanel, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, play, removeToolbar, setApplet, setName, update
Methods inherited from class edu.ucla.stat.SOCR.core.SOCRValueSettable
createComponentSetter, createValueSetter, createValueSetter, createValueSetter, createValueSetter, getComponentSetter, getComponentSetters, getValueSetter, getValueSetters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.ucla.stat.SOCR.core.Pluginable
getName, setApplet

Field Detail


public static final int STANDARD
See Also:
Constant Field Values


public static final int BLIND
See Also:
Constant Field Values
Constructor Detail


public MontyHallGame()
This method initializes the game, including the toolbar buttons, doors, images

Method Detail


public void reset()
This message resets the game

Specified by:
reset in interface IGame
reset in class Game


public void actionPerformed(java.awt.event.ActionEvent event)
This method handles the events for the Play button

Specified by:
actionPerformed in interface java.awt.event.ActionListener
actionPerformed in class Game


public void itemStateChanged(java.awt.event.ItemEvent event)
This method handles the events for the host choice

Specified by:
itemStateChanged in interface java.awt.event.ItemListener


public void mouseClicked(java.awt.event.MouseEvent event)
This method handles events for the door clicks

Specified by:
mouseClicked in interface java.awt.event.MouseListener
mouseClicked in class MultiplePartsPanel