Trouble creating a Tic-Tac-Toe AI

I need to create a tic-tac-toe game for my college final project. We have some rules, such as not using extensions, and the game being for only one player, the other being controlled by an AI created by us students, or even using an algorithm that chooses a random button.

I managed to make a game where the button chosen by the "AI" is random, but ideally I would like to create something, even if super basic, that at least tried to beat the player. Is it possible to do this in App Inventor without any extensions, just the basic blocks?

I looked for several tutorials, but several of them only showed the process with two human players, or using some extension.

I would also like to know how I could do some victory condition, even if my "AI" is randomly controlled, as I ended up doing. I also have no idea how to do this. Thanks.

JogoDaVelha.aia (28.0 KB)

did you check this tutorial? Rock Paper Scissors Tutorial (