Can you provide some pseudocode examples of what constitutes an AI?
AI is not a simple term. There are different types, ranging from the most simplistic rule-based AI to black-box AI's so complicated it's unreasonable for a human to understand exactly what they're doing.

There's no pseudocode that if used in a program automatically constitutes it as an AI. It's not that black and white. But I can give examples:

Here's a rule-based chess AI that forfeits if it's too far behind, and plays aggressively if it's far enough ahead.

if player.score - my.score &gt; 10:
    forfeit
elif my.score - player.score &gt; 10:
    agressive = True

for each piece of my.pieces:
    for each square of board.squares:
        if noThreats(square) and agressive is True:
            move(piece, square)
            return


This is considered an "AI" because it feigns intelligence - appearing to have a true understanding of chess while simply following a set of rules, making it an "Artificial" Intelligence.

Here's another more complicated AI:

decisionNet = NeuralNetwork(64 inputs, 2 outputs)

choice = decisionNet(board.squares) // Returns a chess square with one of my pieces and desitnation 
move(choice)


This uses a neural network to make the decision, which could have been trained on a bunch of example games or against itself. Due to this "training phase", humans can't understand precisely what the network is doing without extensive effort, so it's an even gives an even more convincing understanding of chess. But if we want, we could still understand the nuances of this network, and show it doesn't possess an intelligence, it again only feigns it.

I should mention that virtually any code that has an if statement can be considered AI. The examples I provided are just easier to pass off as understanding a very complicated concept (chess), as opposed to, say, verifying a user login. They both have the same fundamentals, it's just one appears more complicated on the surface than the other.