Arcade
This page is to journal my construction of the arcade.
Technology stack
Frontend:
- React with Typescript
- Tailwind CSS
- Zustand (simple state management)
- Framer Motion (smooth animations)
Backend:
- Node.js with express
- Rest API
Steps
mkdir -p backend/src/controllers backend/src/models backend/src/routes
mkdir -p frontend/src/components/games frontend/src/pages frontend/public
- create
package.jsonfor both backend and frontend - create main backend file, game routes, game controller
pm2configuration for containerisation- create
tailwindconfig - create
App.jsin frontend
Resources to work through
Chess
AI Strength Analysis:
Architecture
Iterative deepening minimax with alpha-beta pruning, running in a Web Worker. The search deepens incrementally (depth 1, 2, 3, …) until the time budget expires, always keeping the best result from the last fully completed depth.
Per-difficulty estimates
┌────────┬─────────────┬───────────────────────┬──────────────────────┬─────────────┐ │ Level │ Time budget │ Typical depth reached │ Est. nodes evaluated │ Approx. Elo │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Easy │ 1s │ 4-5 ply │ ~50k-200k │ ~1200-1400 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Medium │ 2s │ 5-6 ply │ ~200k-800k │ ~1400-1600 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Hard │ 3s │ 6-7 ply │ ~500k-2M │ ~1600-1800 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Expert │ 4s │ 7-8 ply │ ~1M-5M │ ~1800-2000 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Master │ 5s │ 7-9 ply │ ~2M-10M │ ~1900-2100 │ └────────┴─────────────┴───────────────────────┴──────────────────────┴─────────────┘
What makes it strong
Piece-square tables (PST) — It knows positional chess: control the center, develop knights away from edges, castle the king, advance passed pawns. Even at depth 4 it plays principled chess.
- MVV-LVA move ordering — Captures are searched in Most Valuable Victim / Least Valuable Attacker order,
which makes alpha-beta pruning very effective (prunes ~90%+ of the tree).
- PV move ordering — The best move from the previous iteration is searched first at the next depth, which is a huge speedup.
- Endgame awareness — Switches king PST from “hide in the corner” to “march to the center” when material
drops below ~2600cp (roughly when queens are off).
- Auto-queen promotion — It always promotes to queen, which is correct 99%+ of the time.
What it lacks (potential weaknesses to exploit)
- No quiescence search — This is the biggest weakness. The search evaluates positions at a fixed depth
with no extra capture-chain resolution. This means it has a horizon effect: it can’t see that a sequence of exchanges ending 1 ply beyond its depth is losing. Exploit this by initiating complex tactical exchanges — it may miscalculate the outcome.
- No transposition table — It re-evaluates the same positions multiple times. This limits depth but
doesn’t create an exploitable weakness per se.
- No opening book — It calculates everything from scratch. You can gain a small early advantage by
playing well-known strong openings (e.g. Italian Game, Ruy Lopez, Queen’s Gambit) while it burns time recalculating known theory.
- Simple evaluation — No understanding of: pawn structure (doubled/isolated/passed pawns beyond PST),
bishop pair bonus, rook on open files, king safety beyond PST, or connectivity. You can exploit positional themes it doesn’t understand — e.g. create a passed pawn on the side it’s not watching.
- Random tiebreaking — When two moves evaluate equally, it picks randomly with 50/50. This means it
occasionally makes suboptimal choices in quiet positions.
Tips to beat it on Easy/Medium
- Play solid openings — 1.e4 e5 2.Nf3 Nc6 3.Bc4 (Italian) gives you natural development
- Trade queens early — the endgame evaluation is weaker, and you remove its tactical sharpness
- Create long-term positional advantages — passed pawns, bishop vs knight in open positions, rook on the
7th rank. It can’t plan strategically, only tactically within its horizon
- Avoid sharp tactical positions — even at 4-5 ply depth, it calculates accurately within that window.
Don’t leave pieces hanging or set up tactics it can see
- Push into the endgame — its endgame play is the weakest phase due to no specialized endgame knowledge
(no opposition, no Lucena/Philidor patterns, etc.)
Backlinks (3)
1. Chess Bot /wiki/ai/adv-search/chess-bot/
two chess projects live in this codebase, and honesty requires separating them up front. the first is a from-scratch javascript engine (in arcade/references/chess/js/, built following the classic bluefever software series): 120-square mailbox board, hand-rolled move generator validated by perft, material + piece-square evaluation, alpha-beta with quiescence, a principal-variation hash table, and iterative deepening. the second is voice chess (code/private/chess-bot/, published as github.com/abaj8494/ollama-voice-chess): there i did not write the engine — stockfish plays the moves over uci — and the engineering is in the wrapper: skill throttling, an ollama llm that provides spoken commentary without being allowed to hallucinate moves, neural tts, and spaced-repetition opening training. one project teaches you how engines work; the other teaches you what to build around an engine.
𐃏
2. Sudoku /wiki/ai/csp/sudoku/
sudoku is the drosophila of constraint satisfaction: small enough to hold in your head, rich enough to demonstrate every solving paradigm that matters. this page works through four of them against my actual code — a backtracking solver with \(O(1)\) constraint sets (arcade/references/sudoku/solver.py), a dart port that also generates puzzles (arcade-mobile), an integer-programming formulation solved for real with scipy, and the exact-cover view that leads to knuth’s algorithm x. every timing below is a real run on this machine.