At first, I recommend you start with some Coursera material.
Machine Learning with Andrew Ng is always a must for beginners.
There are plenty of other options, of course.
I suggest you try 3Blue1Brown on YouTube, in order to understand the intuition of some useful mathematical concepts.
Then, when you feel more comfortable with ML concepts and problems, I ...
There are a few different ways to improve on your simple heuristic approach, but they mostly resolve to these three things:
Find a better heuristic. This could be done by calculating probabilities of results, or running loads of training simulations and somehow tuning the heuristic function.
Look-ahead search/planning. There are many possible search ...
TL;DR: What makes AI is not if-then statements, but rather the automated reasoning that went into selecting those particular if-then statements.
You're focusing on the structure of the output rather than how the output was produced. Having if-then control flow statements is not sufficient to make a program "AI". AI aims to enable machines to solve ...