I congratulate you if you beat this AI! It's quite smart! Good luck!
P.S. I know my code may be a bit superfluous but, unless anyone simplifies it for me, I'm not changing it. UPDATE: All glitches removed! Easy win situation was also eliminated! UPDATE: User interface added!