FiveInARow component 1.0
========================

  Last revision date Feb 10, 2000.

  Copyright (C) 2000 Gran berg, All rights reserved. 


Description
===========

  Five in a row is a game that is known under a lot of different names.
  Pente, Gomuko, and Renju are only a few examples. The object of the
  game is to get five crosses or noughts in a row, either in a
  horizontal, vertical or diagonal direction.

  The FiveInARow component provides a highly customizable 2D Grid that
  can keep track of a game and verify the legality of moves. A game
  engine has been added to the component and uses a fast algorithm for
  thinking. You can choose number of rows, columns, size, colors and
  playing strength at runtime. Optionally you can use the component for
  a game between two humans.


Distribution license
====================

  The FiveInARow component may be freely used and distributed by anyone
  for non commercial use.

  If you want to use the FiveInARow component in a commercial software
  you have to register the component for 10$. If you register the
  component you will receive the source code and future versions for
  free.

  The author does not accept liability for the software in any way.


Installation
============

  Borland C++Builder 1
  --------------------

  Register the FiveInARow component to the component library
  using the following steps:

  1. Choose Component|Install from the main menu.
  
  2. Click on the Add button and then the Browse button.
  
  3. Navigate to the directory where you placed the FiveInARow files.
  
  4. Locate the FiveInARow.obj file and click the Open button.
  
  5. Click the OK Button to rebuild the component library.
     The component library will now be rebuilt, and should include
     the FiveInARow component.

  C++Builder 1 might complain that it can't find some files. In this
  case, a workaround is to copy the respective files to the Bin folder
  of your C++Builder 1 installation.
  

  Borland C++Builder 3
  --------------------

  1.  Before you install the FiveInARow component, copy all the
      necessary files to the appropriate directories. In general,

      - FiveInARow3.bpl file belong in the Windows\System or
        CBuilder3\Bin directory. Wherever you put the file, it
        must be found on the Windows path.

      - FiveInARow3.bpi and FiveInARow3.lib files belong in the
        CBuilder3\Lib directory. (The .lib files are required for
        static linking.)

      - FiveInARow.h file belong in the CBuilder3/Include directory.

  2.  Choose Component|Install Packages from the IDE menu, or choose
      Project|Options and click the Packages tab. A list of available
      packages appears under Design packages.

  3.  Add the FiveInARow package to the list, click Add and browse in
      the Add Design Package dialog for the directory where the
      FiveInARow3.bpl file resides (see step 1). Select the file and
      click Open.
  
  4.  Click OK. The component library should now include the FiveInARow
      component.

      If you install a package while no other project is open in
      the IDE, the new package will be added by default to future
      projects. To prevent this, uncheck the new package in the
      Design Packages list, select the Default check box, and
      click OK. (This updates the Default.bpr file in the
      CBuilder3\Bin directory.)


  Borland C++Builder 4
  --------------------

  1.  Before you install the FiveInARow component, copy all the
      necessary files to the appropriate directories. In general,

      - FiveInARow4.bpl file belong in the Windows\System or
        CBuilder4\Bin directory. Wherever you put the file, it
        must be found on the Windows path.

      - FiveInARow4.bpi and FiveInARow4.lib files belong in the
        CBuilder4\Lib directory. (The .lib files are required for
        static linking.)

      - FiveInARow.h file belong in the CBuilder3/Include directory.

  2.  Choose Component|Install Packages from the IDE menu, or choose
      Project|Options and click the Packages tab. A list of available
      packages appears under Design packages.

  3.  Add the FiveInARow package to the list, click Add and browse in
      the Add Design Package dialog for the directory where the
      FiveInARow.bpl file resides (see step 1). Select the file and
      click Open.
  
  4.  Click OK. The component library should now include the FiveInARow
      component.

      If you install a package while no other project is open in
      the IDE, the new package will be added by default to future
      projects. To prevent this, uncheck the new package in the
      Design Packages list, select the Default check box, and
      click OK. (This updates the Default.bpr file in the
      CBuilder4\Bin directory.)


Product History
===============

  Version 1.0 - February 10th 2000
  -------------------------------  
    
    Initial version (C++Builder 1, 3 & 4).


Description
===========

  Properties
  ----------

    bool AutoResponse
      Set AutoResponse to true if you want the computer to move
      automatically after a user move. Set AutoResponse to false
      if you want two humans to play against each other.    
    
    TColor Color
      Use Color to read or change the background color of the
      component.      


    bool ClickResponse
      Set ClickRespone to true if you want the component to responde
      on mouse clicks.

    int ColCount
      Read ColCount to determine the number Columns in the grid. Set
      ColCount to add or delete columns in the grid.

    TColor CrossColor
      Use CrossColor to read or change the color of the cross symbol.

    TColor FiveInARowColor
      Use FiveInARowColor to read or change the marking color of a
      winning row.

    bool GameOver (read-only)
      Read GameOver to determine if there is a game in progress.     

    TColor GridLineColor
      Use GridLineColor to read or change the color of the grid lines.    

    TColor HighlightColor
      Use HighlightColor to read or change the highlight color of the
      latest move.

    bool Lock
      If Lock is true, the component ignores mouse clicks and the user
      cant move. To unlock the component, set Lock to false and the
      user can use the component.      

    TColor NoughtColor
      Use NoughtColor to read or change the color of the nought symbol.

    int PlayingStrength
      Set PlayingStrength to specify the playing strength of the game
      engine. These are the built-in values provided by TStrength:
      stLow, stMedium and stHigh.

    int RowCount
      Read RowCount to determine the number of columns in the grid.
      Set RowCount to add or delete columns in the grid.

    bool ShowFiveInARow
      Set ShowFiveInARow to true if you want to mark the winning
      row in a different color.


    bool ShowHighlight
      Set ShowHighlight to true if you want to highlight the latest
      move.


  Methods
  -------

    void ComputerMove()
	Use ComputerMove method to let the computer make a move.

    void Move(int x, int y)
        Use Move method to let the user make a move. The upper left
        corner is x=1 and y=1.

    void NewGame();
	Reset the position to the initial state. 


  Events
  ------

    OnComputerWon
      Use the OnComputerWon event handler to cause any special
      processing to occur when the computer is winner of the game.

    OnCrossWon
      Use the OnCrossWon event handler to cause any special processing
      to occur when the owner of cross symbols is winner of the game.

    OnDraw
      Use the OnDraw event handler to cause any special processing
      to occur if the game board is filled with crosses and noughts
      and the game is drawn.

    OnUserWon
      Use the OnUserWon event handler to cause any special processing
      to occur when the user is winner of the game.

    OnIllegalMove
      Use the OnIllegalMove event handler to cause any special
      processing to occur if the user tries to put a cross or a nought
      in an occupied cell. 

    OnLegalMove
      Use the OnLegalMove event handler to cause any special processing
      to occur when the user or the computer makes a move.

    OnNoughtWon
      Use the OnNoughtWon event handler to cause any special processing
      to occur when the owner of nought symbols won.


Contact the author
==================

  I hope this text file answers all your questions.
  If not, drop me a line!

  Just drop me a line if you have any bug reports, comments,
  suggestions, or wanted features.

  I wish to thank all those who mailed me their thoughts and ideas.

  Hope you enjoy this component and I look forward to hearing
  from you soon!

  Gran berg
  Lnggatan 10
  77632 Hedemora
  Sweden
  goe@hem.passagen.se
  ICQ# 2037858
  +46-703651276