I think the AI might be bugged because 3 times in a row the AI only needed to sink one more ball of it's color and for some reason shot at the black ball ending the game, is this a bug or is the computer just pitying me for being bad at pool?
Hard to say without seeing it.
The AI is pretty basic though. If it can't find an unobstructed shot then it will often do something silly. It also doesn't understand bank shots or consider what could happen if it hit the other balls on the table.
I had some ideas about making it smarter, but ran out of space to implement them :)