How to make a bot to learn from previous games
Reinforcement learning

The problem that you describe, namely, choosing a good sequence of actions based on a reward/score received based on the whole sequence (and possibly significantly delayed), is pretty much the textbook definition of Reinforcement learning.

As with quite a few other topics, deep neural networks currently seem to be a promising way for solving this type of problems. This may be a beginner-friendly description of this approach.