The program is modelled towards a model-view-controller pattern.

Additionally there are helper objects that make building card games easier:

Each card game is implemented as a new set of rules. To ensure decent isolation, each rule file is only allowed to modify the game through the controller object.

Program Flow

+---------+
| DECK.JS |
+-^-------+
  |            +----------------+
  |        +--->  GAME RULES.JS <--+
  |        |   +----------------+  |
  |        |                       |
+-+--------+-+                   +-+-------+
|  MODEL.JS  <-------------------+ VIEW.JS |
+----------+-+                   +-+----+--+
           |                       |    ^
           |   +---------------+   |    |
           +---> CONTROLLER.JS <---+    |
               +-------+-------+        |
                       |                |
                  EVENT|DRIVEN          |
                       |                |
               +-------v-------+        |
               |               +--------+
               |   GAME LOOP   |
               |               |
               +---------------+

Journal

Date Title
design pattern
rules