Mystery Master Mystery Master
The Project

The components of the Mystery Master application
 

The Mystery Master program is one of several components that make up the Mystery Master project. These components are all written in Microsoft's new .NET language, Visual C#, but no knowledge of programming is required to use the Mystery Master program. Some of the source code is available to members by clicking on its link. While you read about each component, you will encounter terms such as "executable" and "dll". Just remember that an executable program is an application (Word and Excel are examples of applications), whereas a dll file (dll stands for Dynamic Link Library) contains software, but cannot run on its own. If you are interested in learning Visual C#, I have found the following two books Beginning Visual C# and Professional C#, both published by Wrox, to be very informative.


Here are the components that make up the Mystery Master project.

  1. The Program component
    This is the executable file (MysteryMaster.exe), simply called the program. The program provides the visual interface (GUI) for the other components. It has a main window, menus, toolbars, forms, and all the other cool stuff found in a modern application.

  2. The Puzzle Data component
    The data component is a class library named PuzzleData.dll. This component contains the puzzle data when a puzzle is loaded, and has methods to insert/delete data from its storage area. Each puzzle module derives (inherits) from this class.

  3. The Puzzle Solver component
    This component, called the solver, is a class library named PuzzleSolver.dll, and is the "brains" behind the program. The solver loads the puzzle file, solves the puzzle, and tells the program what to display.

  4. The Puzzle component
    A puzzle is a class library (dll file), and is called (you guessed it) the puzzle. Puzzles are selected within the program, but are processed by the solver. Because any puzzle at any time can be loaded by the program, these puzzle modules are truly "dynamic" dll files!

The Program Component
The Mystery Master program consists of forms and classes. Forms are windows that display the visual elements of the program, while classes are non-visual modules which contain only code. Since the program is a MDI (Multiple Document Interface) program, there is a main window called the parent window, which contains one or more child windows. The parent window also contains several visual objects called controls. These controls are the Menu control, the ToolBar control, the StatusBar control, and the Timer control. Please take a look at the manual for more information about these forms.

The following list contains all of the forms used by the program. As you will see, my naming convention is to start the name of each form with "frm" (I know that's an old Visual Basic naming convention, but I still like it).

As mentioned earlier, classes contain only code. Because the Mystery Master program relies on external modules (the PuzzleData.dll and the PuzzleSolver.dll files), there is only one class needed. The name of the class is SolverEvents and as the name suggests, it handles events raised by the puzzle solver module.


The Puzzle Data Component
This component contains the classes to store and retrieve the puzzle data. Because all components were written according to object-oriented programming (OOP) techniques, all data structures are defined as classes. The following list contains all of the data structures defined in this component. My naming convention is to start the name of each class that is a data structure with "cls". As you will see, most of these classes have the same base name as the forms used in the program component.

You may have noticed that after each type of data, there may be a corresponding class with the name pluralized and defined as a collection. A collection is like an array of zero or more elements. For example, the Facts collection contains zero or more elements of type Fact. What makes a collection better than an array is that not only can you find a particular element using an index, you can easily add and remove any element as well.

There are two classes that do not define data structures. The class that handles all data transactions is called the Data class. The other class, which handles saving a logic puzzle to a file, is called the Filer class. The Filer class can save everything defined in a logic puzzle except the links and rules. Because links and rules need to be programmed, this is best done in a programming IDE (Integrated Development Environment) such as Microsoft's Visual Studio .NET.


The Puzzle Solver Component
All of the intelligence of the Mystery Master is packed into this one component. The data structures defined in this component are given below.

In order to read a logic puzzle module (the puzzle component), all puzzles must be written to use an interface. This interface is called IPuzzle.

The algorithms to solve a puzzle are spread out among the classes given below.


The Puzzle component
The last piece of the puzzle (bad pun in progress) is the puzzle itself. This component contains the data and methods necessary to define the puzzle. Every Mystery Master puzzle module must conform to the IPuzzle interface defined in the solver component. There are three public methods each puzzle module must have. These methods are:

If you are a member of the Mystery Master Agency, you may view the source code for the puzzle module Spy Girls.


home puzzles manual download project email links about
Copyright 1997 - 2008 Mystery Master