Prajowola.
Let's Talk
Back to Projects

Source code

Tic-Tac-Toe

A classic 3×3 game with Easy, Medium, and Hard computer opponents — Hard uses the minimax algorithm and can never be beaten.

Built with

HTMLCSSJavaScript

The download is a single self-contained .html file — all the markup, styling, and game logic live in one place, with no libraries or build tools.

Main features

  • Three AI difficulties: Easy (random), Medium (blocks and takes wins), Hard (unbeatable minimax).
  • Automatic win and draw detection with the winning line highlighted.
  • Pure DOM — no canvas, no libraries, no build step.

How to run it on your device

  1. 1. Click Download source code above to save the .html file.
  2. 2. Double-click the file (or right-click → Open with → your browser).
  3. 3. The game runs instantly — no installation, no internet connection needed.
  4. 4. Want to peek inside? Open the same file in any text editor to read and tweak the code.