Haha, think againhgm wrote:Why by 8? You expect your engine only to survive 8 moves?
For exemple, with 300 seconds left :
Move 1 : 300/8 = 37 seconds
Move 2 : (300-37=263)/8 = 32 seconds
Move 3 : (263-32=231)/8 = 28 seconds
Move 4 : (231-28=203)/8 = 25 seconds
Move 5 : (203-25=178)/8 = 22 seconds
Move 6 : (178-22=156)/8 = 19 seconds
Move 7 : (156-19=137)/8 = 17 seconds
Move 8 : (137-17=120)/8 = 15 seconds
Move 9 : (120-15=105)/8 = 13 seconds
and so on....
Actually, the program will have more time than that, as it never use the maximal amount of time allowed : at each ply fully searched, it computes how many time it used for it and estimates how much it would take to search a new ply. If the result exceeds the time allowed, it will just stop searching. Most of the time, it will just use a sixth of the time allowed (it's actually related to the alpha beta branch pruning factor).
Yes, I know it's not a very efficient algorithm, but I focused on the chess algorithms instead. The day the engine will start to play well, I'll put more thinking in those algorithms.
And... even with plenty of time left anyway, Pred might not survive its 8th move.