I’ve been thinking about having an AI play a game but it’s a pattern matching machine, how could it ever play?

While I found one article about it most results are about the AI making a game

Its github has a Jupyter notebook about it.