Spoiler

What I did is define a way to calculate a score for each board position. I used something very simple:

+4 points for each empty square

+4 points for each pair of adjacent cards that can be merged

-1 point for each card which is between two higher cards vertically or horizontally (-2 points if both)



The reasoning behind the scoring should be clear: reward empty spaces or spaces which can be emptied later, and penalize checkerboard patterns which are harder to get rid of.



The algorithm then simply tries all possible moves, computes the score of the possible resulting board positions (accounting for all possible positions where the next card can be inserted, and all possible values if it's a bonus card) and picks the move that gives the highest average score.



That's all! So as you can see I don't care about "corner strategy" or anything like that, nor do I look at more than one move in advance: I just look at the empty space on the board, and that's enough to get pretty far into the game.