I’ve got a working game with all of the necessary functions. Next I’ll move on to a better presentation.
Something I thought would be fun: the AI knows how to play perfectly, but it has a 1 in 10 chance of making a random play instead of the correct one. This gives the player a chance to actually win once in a while.