pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
506 stars 117 forks source link

Board: Modular implementation #104

Closed lemonsqueeze closed 5 years ago

lemonsqueeze commented 5 years ago

Split out board.c to better reflect what it's doing: We really have 2 different board implementations, might as well give them a place to be.

board.c and board_undo.c both include board_play.h so each gets its own board_play() logic optimized for its own needs without duplicating code. Still need a few #ifdefs where logic differs but already it's so much nicer this way. For undo use board->u instead of passing undo pointer through every function (can't believe i wrote this !)

Speedup / convenience:

Playouts are about 7% faster almost for free.