

Bash Noughts & Crosses (Tic Tac Toe)
So as one or two regular readers may have noticed, I occasionally write terminal games. Everyone needs a hobby, right?
This is one I'd intended to write for a long time, albeit not necessarily in Bash, because it uses a technique called 'Minimax' that I had to study on an AI course decades ago, but never coded.
Until now. I've reused the same mouse control function from previous games. Hope some may find it of interest.
If I'm honest, it was probably a lot more interesting as a coding exercise than as a game, because by default it's impossible for the computer opponent to lose. I've introduced a "compromised" mode to overcome this and let the human win occasionally.