the vague idea I have right now is having a function to evaluate the value of a given hand based on what you know about whats already been played and then trying to pick a play with the best result for the trick with maximizing the value of the hand you're left with as a consideration.