Add a smarter tip algorithm and helper functions

Try to use a-b pruning for red player to place blocks