One Million Chessboards: A Single-Process Server Handling Millions of Concurrent Chess Games

2025-07-16
One Million Chessboards: A Single-Process Server Handling Millions of Concurrent Chess Games

The author built "One Million Chessboards," an online multiplayer chess game where a 1000x1000 grid of chessboards forms a single global game. Every move instantly affects the entire board, with no turns and inter-board movement allowed. Running on a single Go process, the game attracted over 150,000 players in 10 days, processing over 15,000,000 moves and hundreds of millions of queries. The article details the game's system design, data distribution, protocol optimizations, optimistic locking, and rollback mechanisms. The author shares lessons learned, including performance optimization, architectural choices, and balancing game scale with player experience. The post concludes with reflections on design flaws, such as the lack of an awe-inspiring scale, and future game development plans.

Read more

One Million Chessboards: A Massively Multiplayer Chess Game Unlike Any Other

2025-04-28
One Million Chessboards: A Massively Multiplayer Chess Game Unlike Any Other

A developer built a website called 'One Million Chessboards' featuring, you guessed it, one million chessboards! All players share the same boards, moving pieces instantly without turns. The developer overcame significant technical hurdles, building the backend in Go (their first Go project!), utilizing a single writer thread and numerous reader threads, and implementing optimistic locking for concurrency. This project is a technical feat; play it and experience massively multiplayer chess like never before!

Read more

Running Pong in Browser Tabs

2025-02-20
Running Pong in Browser Tabs

A developer ingeniously runs Pong across 240 browser tabs! Using AppleScript to create a tab grid, Web Workers for efficient background updates, and Broadcast Channel for inter-tab communication, they render the game on tab favicons. This project showcases the power of browser APIs and creative problem-solving.

Read more
Development creative coding

Bad Apple in Vim: 6500 Regexes and a Whole Lotta Magic

2025-01-12
Bad Apple in Vim: 6500 Regexes and a Whole Lotta Magic

This post details how the author rendered the Bad Apple music video within Vim using only search queries. Each frame was converted into a binary pixel array, decomposed into rectangles, and represented by a Vim regex. The result? A file containing over 6500 regexes, played sequentially via a Vim macro to create the animation. This impressive feat showcases Vim's surprising capabilities and the author's considerable programming skill.

Read more
Development Regex