AI pascal units Mill tournament

Greetings All.

--- I would like to announce about the 1997' tournament of AI pascal
unitsin the game of Mill.

The tournament will take place in Israel during February 1997. The
software which manages the tournamant will be run in Turbo Pascal 7

--- The organizers & judgers of the tournament are:
Toni Froich, Germany, email:
Yuval Heller, Israel, email:

AlI units which will participate in the tournament must be sent to me
before February 97. (See instructions for making the units below.)

There is no financial award for the tournament. The tournamnt outcomes
will bepublished after the tournament end. The games will be avaliable

in a database. Best games & the winning unit/s will be analysed &
published.( with their  authers' apporval.)

--- What's Mill?

Mill is a game for 2 players in the Tic-Tac-Toe style. The board is a
3d 4*4*4
cube which contains therefore 64 cells.
The white player begin & put one of his 32 balls in a cell. In the
following turn the black player will play & put one of his 32 balls.
There is a gravity in the Z axis direction thus a ball will fall down
to the lowest empty cell in his column.

After that, each player play alternately, each time with one ball.

The objective of the game is to have 4 of your balls (i.e balls with
color) in a straight line. This line may be horizental, vertical or
For example, each of those 4 coordinates of XYZ is a straight winning
balls line:
111, 112, 113, 114.
111, 222, 333, 444.
111, 122, 133, 144.
111, 112, 113, 114.
444, 434, 424, 414.

The first player who gets the objective immdiatly wins. If the board
completely full (all the 64 balls were played) then the game is
finished in
a draw.

--- What are the tournament rules?

The tournament is played in a league system. Every unit plays against
all the other units a
constant even number of games. (The exact number of times each unit
against another unit will be determined according to the number of
units who
participate. It'll be at least 10.)

A half of the games against each opponent will be played in white &
a half in black.

Each unit will have 1 minute for playing the entire game.
If people will be interested, other time-limits games will be played.
(There will be, for example, a main 1 minute championship & a 10
seconds fast
game championship & 15 minutes slow game championship.)

If a unit sent back an illegal move, it loses immediatly.
The units can't get any other information beside the variables which
are sent to its.
(See the parameters below in the "structure of units" section.)

--- What is the Mill manager?

The mill manager is a freeware which is capable of managing a mill
between two units. The manager is under construction. Final version
will be
able to do any needed function in managing the Mill tournament.
Current version can show the board graphically, manage a game (count
time, call to units,
check who won/drew), count vicotries for each of the units.

Programmers can use the manager to test their units in playing mill.

A copyright notice:
All the rights for the programs in that zip (G3dparnt & all of his
are reserved (C) for it's programmer Toni Froich.
You may not change anything in that program nor use it or any parts of
(except to the using which is approved below) without the explicit
of Toni Froich or Yuval Heller.

You may use this program or any parts of it (& modified parts of it)
for preparing your unit for the mill AI tournmant. You must give
credit for
the programmer for such use.

--- How can I get the mill manager?

The manager is a 30k zipped file.
If you send me an email asking so, I'll uuencode & send you the file.
I'll be happy if someone could put the file in his FTP directory or in
WWW page. Please contact me by email if you are willing to do so.

--- What should be the units' structure?
The units should be in Pascal, compatiable to Turbo Pascal 7.

Each unit should be named in a 7 letters name & should be stored in a
 file with the same name. Each unit must have a function which is
P+"7 letters name". For example, "pyuval_h" for my function in my
unit "yuval_h".

The function (pyuval, for example) must contain the following lines:
(assuming that a 5 letters name "yuval" is allowed. In reality use a 7
 letters name.)
unit Yuval
uses B_Type

function PYuval(who:byte;board:Tboard;ytime,otime:real):word

function PYuval(who:byte;board:Tboard;ytime,otime:real):word
(In B_type the board type is defined.)
The parameters mean:

- who: which player is the unit.
"1" means that the unit play the "1" balls. (like white balls in
reality) "2" means that the unit play the "2" balls.

- Board: a 4*4*4  from the tboard type: Tboard=array[1..4,1..4,1..4]
of byte.

The 1st is X axis (vector), 2nd parameter in board is Y axis, the 3rd
is Z axis. (Z is the axis with gravity.)

- ytime means the time your unit have in seconds till the end of its
time limit.
- otime means opponent time till time limit. (Flag's fall.)

- The function return a word which:
The lower byte is X coordinate for the cell you want to put your ball
& the higher byte is Y coordinate. (Z coordinating is unneeded because

there is only 1 cell to put your ball in per XY coordinates.)
For example, for entering your X, Y coordinates from X, Y variables
"PYuval:=j shl 8 + i"
Pyuval is your procedure's name.

--- What can I do to help the tournament?

1) Help establish it's Web page & put it's files in a FTP directory.
(I have little experience in those subjects.)

2) Publish, Publish & Publish it to as much as fellow programmers (&
people) as possible.

3) Report me or Toni for any bug you found in the manager. Send me
 any ideas & questions you have about the tournament.

4) If people will be interested I'll establish a mailing list for the
 tournament. In that case I might need someone help to do so.

--- Few technical remarks about using the mill manager:

The G3dparnt needs your screen bgi file (probably egavga.bgi) to be in
specific direcectory. If the program doesn't work, search in the
program (in the beginning of the main program in g3dparnt.pas) the
initialiting the graphic mode & change the directory written there to
directory you have the *.bgi files.

The program also needs a unit file which is in this Zip as well as few
Pascal standard units. Please copy the units file from this zip to
your units

The sample procedures which are in the G3dparent (Tyuval, Ttoni) moves
randomly & are being in the zip for exampling only.

In Toni's words:
The main program "G3DParnt.pas"
needs the TPascal-Units Graph (suit the path, in which the egavga.pas
is ->
initgraph, to Your harddisk) and Crt. The Unit B_Type is only for type
'cause every Unit (Yuval, Toni...) and the main program need the same
The Assembler-file Timer.asm is responsible for measuring the time.
That's why
the time is very exact - value 1 corresponds to 0.838 microseconds and
71599045 is 60 seconds. I began Your Unit with the essentials and a
putting. When You'll change the unit name then suit the 9th and 10th
(G3DParnt) ! Furthermore I added a new parameter "who" to the
Play-routines. It says who's who to the procedures.

Yuval Heller.