How did AlphaZero teach itself? The rules of the games were programmed into the system. Then, AlphaZero started to play itself. The more it played itself, the better it became. Over a few hours, it learned to play the games better than the games had ever been played.