A little bit of information about CMTSOLIT...
---------------------------------------------

CMTSolit source and executable is freeware; if you make substantial use
of it I'd appreciate being mentioned somewhere.

CMTSolit uses a variant of Tom Lee's freeware TOMCARD.PAS to draw the card
images.  Thanks, Tom!  The variant component is in the TOMCARD2.PAS file.


Files for the compiled game--place all in a directory of their own
CMTSOLIT.EXE
CMTSOLIT.INI
CMTSOLIT.R1
CARDS.DLL (This is a 32-bit version, not the same that comes with Win95.  It
  also differs from Microsoft's 32-bit CARDS.DLL in that I drew pips so you
  could tell the suit of an ace when it is buried under other cards)


Delphi 2 vs. Delphi 3

1. The custom cursor (floating image of the card you have selected) changed
from D2 to D3; you'll find the D3 variations bracketed in {$IFDEF VER100}
sections.

2. There is a bug in Delphi 3.0's GRAPHICS.PAS that causes the red & white bitmaps
from CARDS.DLL to appear blue & white!  If you have the source code and
need to know what to fix, ask me.  I don't know if the problem has been fixed in the
updates to Delphi 3 (don't have them yet).  Delphi 2 doesn't have the problem.


How it works (just enough to get you started)

A solitaire game consists of 'piles' of cards, and the cards move from pile 
to pile based on rules.  To represent the piles, I created a component called 
TPile which is nothing more than a TScrollbox with a few added properties, 
e.g a TPile has
-- a color
-- a type corresponding to the different ways piles of cards are used, e.g.
   'tableau' for the spaces where cards are moved back and forth, 'stock' for 
   the cards one holds and deals out during the game, 'foundation' for the 
   places where one builds suits.
-- an orientation (so fanned-out cards are shown going down, going left, or
   going right)
-- numbers which define the rules for when a card may be dropped on the pile, 
   and when one may be picked up.

When a card is 'on' a pile, its Parent property is set to that TPile.  A lot
of the complex-looking code is just tedious walking through piles looking for
a particular pile, then looking through that pile's cards for a particular
card, with a lot of typecasting to get at the card's properties.

CMTSolit.ini contains the names of the available games and the name of the file
containing the rules for that game (at present, all rules are in CMTSolit.r1, which
is also treated as a TIniFile).  See the comments in CMTSolit.ini and CMTSolit.r1
for an idea of how the games are defined.


What could be better

The Undo function is lousy and needs to be redone entirely, e.g. by creating
a stringlist detailing each move.  It should be possible to undo anything, even
autoplays.  Also a multiple-level undo would be helpful.

The deck-dealing function is adequate now but needs to be more flexible for
solitaire games that have more elaborate layout rules.

I wonder if the decks wouldn't be better handled by a TList rather than an
array...shuffling would be easier with the Exchange method.

There is a problem with the Help form; sometimes when you close and re-open it
it comes up blank.

There should be another TIniFile (CMTSolit.sco) which would record number of games played,
number of games won, and total score so some stats could be displayed.

When a pile of cards has been picked up and the player chooses an option from the Game
menu, the "card" cursor should be reset to the default.

In the game Napoleon, after you redeal the top card of the stock faces down--it should be 
turned face up.

The scoring rule for Spider should be cards on foundation plus ordered cards on tableaux.

Some of the pick & drop rules are redundant, but I didn't realize it when I
was first writing them--so they perform more tests than are really required.
Not harmful, just a small waste of CPU time.

Right-click on a pile is supposed to hide the scroll bar so you can see the cards
unobstructed, but it has a side effect of moving the scrollbar back to the top of the pile.


Charles Tyson
ctyson@encompass.net