I can assure you this is absolutely NOT how things are programmed in a game! There are no scripts from which to choose from and that AI runs out of them is a fantasy. And the "number of outcomes" is truly infinite even if the game "feels" scripted.
It is actually programmed as a mathematical...