Ok I see your point. Regardless of the AI that I'm trying to do, my focus as of now is to get rid of all the if/else in the playerlocation functions and put them into a simple for loop that checks if the tile has an X or an O. If the tile does, then the location has been taken. If the tile doesn't, then the move is valid. I also have to take into consideration that I'm using string commands that dictate where the letter will be place. This is the problem that I'm facing. I don't how to check if the tile is empty and that the command that they picked correspond to where they're trying to place the letter and put it into a simple for loop.