Documentation for ec-2.9.1-1 (Upd Dec.10, 2001)
Home || To reach me

Published under GNU Licence see GNU_Licence file
Copyright : Marc DECHICO

This is a first documentation version, just to explain how to use and compile the pgm.
Im a preparing a more detailed documentation.

I) Installing the  pgm

A directory will be created by the unzip cde
All sources, objets and executables will be in one  directory named

Put the zipep file in the directory you want to install it.
cd  directory you chose
or whatever name you used for the download.  

II) Compiling
cd the intallation directory /ec-2.9.1-1  and type make.

III) How to use the pgm
To run the pgm type 

The pgm doesn't move automatically the piece, you have to move the pieces for
each side.
To play  type: m E2 E4 (of course a pawn must be present on E2)
The moves  are not fully controlled so the pgm would allow you to
type m f1 f3 with a bishop on f1!.....
You can go back by typing: b

You have to  choose how deep you want the simulator to explore.
The default is 4 levels with an increment of 2 levels.
To choose 6  levels  and an increment of 2 type:
l 6 2    
On a  PIII 733 I need roughly 2,33 minutes to explore a tree of 6 levels
(l 6 2)from a normal starting chess board with -O3 compiler optimisation. 
But the number of possibilities could be wrong because because of  bugs
More initials moves you have, more time you will need.

It's unpossible to stop the simulation but stoping the pgm by ^C . 
It was possible with the Dos Version by typing ESC (keyboard interrupt:  
the code is still in the sources).
To start the simultation type: r 
To visualize the result type: pm 
you should  get 

LMDeAr Not P0M0P1M1!LMDeAr Not P0M0P1M1!LMDeAr Not P0M0P1M1!LMDeAr Not P0M0P1M1
C0B1C3   0  0 0 0 0!
C0B1A3   0  0 0 0 0!
C0G1H3   0  0 0 0 0!
C0G1F3   0  0 0 0 0!
P0A2A3   0  0 0 0 0!
P0A2A4   0  0 0 0 0!
P0B2B3   0  0 0 0 0!
P0B2B4   0  0 0 0 0!
P0C2C3   0  0 0 0 0!
P0C2C4   0  0 0 0 0!
P0D2D3   0  0 0 0 0!
P0D2D4   0  0 0 0 0!
P0E2E3   0  0 0 0 0!
P0E2E4   0  0 0 0 0!
P0F2F3   0  0 0 0 0!
P0F2F4   0  0 0 0 0!
P0G2G3   0  0 0 0 0!
P0G2G4   0  0 0 0 0!
P0H2H3   0  0 0 0 0!
P0H2H4   0  0 0 0 0!
Nbr=19 Camp=0 Niv=2 Mei_mvt=0 Piece= C Dep=B1 Arr=C3
Blanc= h Noir= m Niv= 2 Inc= 0 Pro Act: 0 Joueur: h 
Column L    is the piece type(r:king, d:Queen, f:bishop, c:knight, p: Pawn)
Column M    kind  of movement
column De   Starting field
column Ar   Arriving field
column Not  Mark attributed by the simulator to the movment 
            It add the better movements encountered  during the simu 
            If  the blanc take a pawn(1)  at first level  but the black  are able to 
            take a bishop(3)  at second level you will get a 1-3 = -2.
P0          Number of Pat that the blancs have been able to do during the simulation.
M0          Number of mat by the blancs.
P1/M1       Same thing but for the black.                    
            These Pat/mat  informations are note actually very reliable because they 
            are based also  on bad moves that nobody would probably choose.
            But you will see them increase when  a side is having difficulties.....
to print the board type: pb

IV) Modifying the pgm to test some chess-board situation
The pgm doesn't provide funtions to allow the player to 
configure the board with a specific starting situation.

You have to modify the source file (ec_init.c) to put the pieces at 
the place you want. I don't remember exactly but don't choose a situation 
where the king is already chess. I also don't give the possibility to 
memorize if rock is possible. 
The pgm consider that the first move is done by the white pieces.

The functin to modify is init_pgm()  from the source file ec_init.c
To add the king white on the A1 case 
 err =ajo_pie(0,'r',1,1);   if (err != 0)  printf("Erreur : %i\n",err);
              !  !  ! !
              !  !  ! !----- Line number (1 to 8)
              !  !  !--------Column number (1 to 8) for A to H
              !  !__________ Piece (King= r, Queen= d, Bishop = f, Knight = c, 
              !                      Rook = t, Pawn= p)
              !------------- Side 0= white, 1= Black

You can also visualize the subsequent initial moves: the chees board will be
printed each time on the screen by uncomment somme instructions in the function
not_cal() at the end of the source file ec_simu.c
The function that is printing the chess-board is aff_ech(blanc) blanc side below 
or aff_ech(noir) black below
V) Problemes 
I have some bug to find.... the known one...king no more eaten.
To much code has been copied, I should have put  some code in  specific functions.
A lot of things must be enhanced.....before going further.

VI) New functions
To make it really a chess player a lot of functions should be added :
_choosing among the best moves having the same mark by analysing the new board situation:
	 number of chess/mat/pat detected
	 number of pieces being under control by by each side
 	 number of pieces being covered by each side.
 further more some different strategies could be chosen by the simulator
 like aggressive/risky or defensive/riskless

_ avoiding to explore some parts of the tree when the lost of  pieces  is to high

_building an opening database for the first moves.

Some unexplored ideas:
_  Choosing some move in order to train the player using a specific piece
	by counting which move involve more a piece than an other one 
	(for example detecting, when a chess  or a taking  occures,
	 if it's made by a given piece)
_ Exploring the tree to find some excpetionnal board situations where for example
 	 a side having difficulties would win 
_ Finding some tree parts where a side as more chances to win ,excluding of course
	situations where a side has less pieces than the other.
	(it was primarily one of the motivations for making this pgm) 

Home || Top