$Id: TODO,v 1.10 2004/01/09 19:27:48 khalek Exp $

This file is intended to be a general list of things that need doing features,
bugs whatever.

			--BUGS--
* Fix all the "Problem found" occurances
* Bot segfaults when it has lines added by an opponent
* Bot seems to use switch on itself as soon as it gets one?
* Bot used clear line on other players at least once
* Occasionaly segfaults: ie
	(gdb) bt
	#0  0x400a1c68 in mallopt () from /lib/tls/libc.so.6

			--TODO--
* Remove complete lines in rateField
* make gaps on edge of lines have less effect
* Remove all stdout/stderr output by default to be in line with rules
* Write up explanation of algorithms for submission

		****Bruce's plan for rateField()****
Here is an idea for how this can work.  We have several elements that go
into the rank, each multiplied by a factor, which we can #define to tweak
this easily.  These elements are calculated after complete lines have been
removed, which needs to be written.

elements:
Number of completed lines - depends on target lines variable (should be
passed somewhere), generally make the feild good, but at target of 4 lines
1 line would rank up the field. Note this would have to be done in 2 passes
one after the first peice, one after the second.

Average Height - fairly high factor, not used in block placement (except
in regard to holes) but does affect specials usage.

Sum of height different from one column to the next - can be scaled down
for edge coloums, though some of this is implied as a peak here is only
counted once, same as holes.  High target lines should probably mean a
decrease in the affect of at least edge column gaps, if not elsewhere

Number of blocks over holes - high scaling.  Actually number of holes isnt
so important, often they are uncovered together anyway, or un avoidable, and
some of this is covered in 'Average Height'

Specials value in completed lines - We need a list of specials and how good
they are, and we can add up for each special in these lines, and take this
from the field score

Specials value in uncomplete lines - not used for placement, but is for
special usage.  As above, except rank up lines that have covered holes.

Any other ideas?

		****Bruce's plan for specials****
Most code can be used from the current system.  Function is written which 
returns the highest (average) score for a special (start with last).  To do this
it rates all of the player fields in the way it does now.  Before returning it 
(proportionally - havent worked out exactly how yet) averages between its score
and the score of the next special block, by this same method, and it passes the
modified field, not the current one.
This results in every possible field outcome being tested and ranked.  Time 
shouldn't be a problem, we are waiting for the next block anyway.  Havent yet
worked out exact details on how to do half paths, we may need to generate a tree
of rankings.


	*** Bruce's new specials plan
Recursive function for applying a special effect to a field, and returning the
field rank, depth and array of moves so far.
calls funtion with increasing special depths one and with modified feild.
Returned values are compared with existing rank, and if lower that and depth and
move is stored to be returned.  Once all players have been done rank/depth/move
are returned.
There is a variable for recursion depth, which starts at 6ish.
During the recursion if the recursion depth is reached the special effect
function will not call itself on the next special bock.  After results have
been obtained this way if there are fewer than 3ish blocks to be used, and there
are any nukes or switches past the recursion, the nuke/switch is ranked, and its
score is used to modify the returned rank, if this brings it above the
threshhold all blocks up to there are used (those without targets are chosen
with a basic onteam/not on team function)
To calibrate place recursion depth highish, and print an error if a peice ever
arrives before we are ready.

	*** Bruce's rate feild plan
Loop a 'rateRow' through the feild.  Rows are rated on:
-Height (low is good)
-Gaps (fewer better, unless empty, extra penalty if gaps have a block on top,
	unblocked gaps are less bad if against wall)

This rating is then applied as a modifier to any specials which lie on the row.
The scores are added and returned

This is deceptively effective (IMHO), it covers HEAPS.  it does feild heild,
covered gaps (and accounts for size of these gaps), specials, how accessable
there specials are (height, etc).  It also promotes evenly distributed fields
due to the height bit.  Right now I cant think of anything else we CAN do,
though anything should be able to be added to this system, if you think of any
let me know
