system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How can a program teach itself to play a game like mario cart?
gpt
Software that learns how to play a game is usually based on a machine learning technique called 'reinforcement learning'. 

The problem with learning games is that you don't immediately know wheter a certain action or turn will lead to success (Imagine Go or Chess), so you lack labels for unique actions in the game. 

So you need a different approach - the reinforcement learning:
A reinforcement learning program interacts with the game in time steps. At each time, the program receives an observation which typically includes the reward (like which rank, how many points it got) It then chooses an action from the set of available actions (randomly, or based on previous rounds or actions). At the next time, you see whether this improved, decreased or held the reward.
When the programs performance is compared to that of an program that acts optimally or really good (e.g. a good human mario player), the difference in performance gives rise to the failure or 'regret'. In order to get better at the game, the program must 'reason' about the long term consequences of its actions (i.e., learn patterns that maximize the end result).