A Tic-Tac-Toe game with an AI feature
Human vs Human: X always goes first. Click any square to mark it as X. The next click will be O. Upon win/tie, screen will flash and score will be counted. Click anywhere to clear the screen for the next game.
Human vs AI: When playing against AI, human is always X, AI is always O. AI will let human go first half the time. Every round, AI calculates the list of best possible moves, and picks one randomly from the list. Note: AI does not differentiate between a move that guarantees a win in 1 turn vs a move that guarantees a win in 2 turns; both moves are equally valued.
Can you beat the computer??? https://fengivan.github.io/tictactoe/
Created as a fun project using Javascript/CSS/HTML by Ivan Feng