home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / del2faq.zip / CARDEXP.ZIP / README.TXT < prev    next >
Text File  |  1995-11-16  |  2KB  |  89 lines

  1. TCards
  2.  
  3. This VCL allows the user to easily use the cards supplied with 
  4. Windows in the CARDS.DLL, and build games.
  5.  
  6. PROPERTIES
  7.  
  8. CardBack:     This is the style of the design used to draw the
  9.               card when CardStyle is set to cdBack.  Possible
  10.               values range from 1 - 12.
  11.  
  12. CardStyle:    This depicts how the card will be drawn.  Possible
  13.               values are:
  14.               cdBack:   Draw card back design
  15.               cdFront:  Draw card front
  16.               cdO:      Draw placeholder card
  17.               cdX:      Draw invalid placeholder card
  18.  
  19. Selected:     When selected is true, card is drawn inversed, else
  20.               card is drawn normal.
  21.  
  22. Suit:         Depicts what suit the given card is.  Possible
  23.               values are:
  24.               0:  Clubs
  25.               1:  Diamonds
  26.               2:  Hearts
  27.               3:  Spades
  28.  
  29. Value:        Depicts the value of the card using the formula:
  30.               Value:=FaceValue + (Suit * 13);
  31.               Conversely:
  32.               FaceValue:=Value - (Suit * 13);
  33.  
  34.  
  35.  
  36. Installing TCards
  37.  
  38. To install this VCL, copy both CARDS.DCU and CARDS.DCR to the
  39. directory where you have your other shareware controls.  Then, 
  40. from Delphi's main menu, select Options|Install Components.  In the
  41. dialog, click on the Add... button, then Browse... and change to the 
  42. drive/directory where you stored the above two files.  Select 
  43. CARDS.DCU and click OK, then OK again.
  44.  
  45. Using TCARDS
  46.  
  47. To use this control, simply place it on your form, and edit the 
  48. CardBack, CardStyle, Suit, and Value properties.
  49.  
  50. Sample Procedures:
  51.  
  52. procedure initdeck;
  53. var
  54.     i:integer;
  55. begin
  56.     {Initializes deck array, do once per program, or to reset}
  57.     {deck[1..52] is a global array}
  58.     for i:= 1 to 52 do
  59.         deck[i]:=i;
  60. end;
  61.  
  62.  
  63. procedure shuffledeck;
  64. var
  65.     i,j,k,temp:integer;
  66. begin
  67.     {deck[1..52] is a global array}
  68.     Randomize;
  69.     For i := 1 To 10 do
  70.         For j := 1 To 52 do
  71.         begin
  72.             k := trunc(1 + (52 * Random));
  73.             temp := deck[j];
  74.             deck[j] := deck[k];
  75.             deck[k] := temp;
  76.         end;
  77. end;
  78.  
  79.  
  80. Registering TCards
  81.  
  82. To register TCards and receive source code, send $10 (+$2 S&H) to:
  83.  
  84. Indigo Software
  85. 4240 Park Newport # 308
  86. Newport Beach, CA 92660
  87.  
  88. You can save the $2 shipping fee by specifying a Compuserve or AOL 
  89. account to have your control sent to instead of by mail.