cools maths gamesSurprise me

Chess vs Computer

Take White against a small minimax engine, choosing how deep it searches and using hints and undo to learn.

Chess vs Computer title screen
  • Partly works on mobile
Report a problem

Turn your phone sideways for a bigger view of this game.

Chess vs Computer pits you, playing White, against a compact engine written in JavaScript. You move, the engine thinks briefly, and Black replies. Your goal is the classic one: checkmate the enemy king.

How Chess vs Computer Works

Every standard rule is in place, including castling and en passant. Drag a piece to a legal square to move it, and an illegal move snaps back. With a mouse, hovering over a piece shades the squares it can reach. Pawns that reach the last rank always become queens, for both sides.

The engine uses minimax search with alpha-beta pruning and scores positions using piece values and square tables. After each reply it reports how many positions it checked and how long it took.

An Advantage bar shifts as the balance changes. The Status line flags check and explains how a game ended: checkmate, stalemate, threefold repetition, the 50-move rule or too little material to mate.

Your First Few Minutes

  1. Open Settings and set the engine depth to 2.
  2. Drag a center pawn forward two squares.
  3. Watch the blue outline to see how Black answered.
  4. Check the Advantage number after each move to spot mistakes.
  5. If you blunder, press Undo, which takes back your move and the reply.

Controls for Chess vs Computer

Keyboard, mouse and touch controls for Chess vs Computer
To do thisMouseTouch screen
Move a pieceDrag the piece to its new squareDrag the piece to its new square
Preview legal movesHover over one of your piecesnot used
Take back your last move and the replyClick "Undo"Tap "Undo"
Replay moves you took backClick "Redo"Tap "Redo"
Change engine depth or turn on hintsOpen "Settings" and pick a value or tick the boxOpen "Settings" and pick a value or tick the box
Load an opening or restartOpen "Opening Positions" and click a buttonOpen "Opening Positions" and tap a button

What It Trains

Chess is strategy in its purest form. You plan several moves ahead, weigh trades and protect your king while building an attack.

This version also makes your thinking visible. The live score shows when a move hurt you, and hints let you compare your choice with the engine’s.

Strategy Notes

  • Climb slowly. Win a few games at depth 2 before trying 4 or 5.
  • Read the score jump. A sudden swing after your move often means a piece is hanging.
  • Treat hints as advice. Look at the suggestion, then decide whether it fits your plan.
  • Study a single opening. Load one line and practice the positions that follow it.
  • Watch for stalemate. Since promotion is always a queen, check that the enemy king still has a move.

Good to Know

You can drag pieces by finger, but on narrow screens the menus stack above the board, so a wide screen is easier. Higher depths make the page wait while the engine thinks. The engine is Zhang Zeyu’s open-source chess-ai, with piece images by Cburnett.

Chess vs Computer questions and answers

Is Chess vs Computer good for beginners?

Yes, if you lower the depth. At depth 1 the engine only checks its own next move, so it misses simple threats. You can raise it step by step up to 5, which plays far more carefully but also thinks longer.

Can I play as Black?

No. You always take White and move first. There is a mode where the engine plays both sides, with its own depth setting for White, so you can watch it play itself.

What do the colored outlines mean?

Yellow marks your last move and blue marks the engine reply. A red outline appears only when the suggested move option is on, showing the move the engine would pick for White.

Which openings can I practice?

The Opening Positions menu sets up the Ruy Lopez, the Italian Game or the Sicilian Defense, or the normal start. It is a quick way to study the middle game after a known line.

Games that use planning ahead like Chess vs Computer

Different rules, same kind of thinking.

Try something from another shelf