惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
小众软件
小众软件
博客园_首页
博客园 - 聂微东
罗磊的独立博客
Recent Announcements
Recent Announcements
U
Unit 42
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
D
DataBreaches.Net
Last Week in AI
Last Week in AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a browser number strategy game where arithmetic b...
love mars · 2026-05-31 · via DEV Community

The idea

Most math games feel like timed quizzes: answer fast, move on, repeat.

I wanted to build something with a different texture. In Number Duel, arithmetic is not the homework you do before the fun starts. It is the move system.

You pick numbers to shape the board, limit your opponent, and set up future threats. The math is simple enough to play immediately, but the choices start to feel surprisingly tactical.

How it works

Each player has an active number from 0 to 9.

On a turn, the two active numbers combine to create a target. You claim the matching cell on a 5x5 board. Connect four cells in a row to win.

For example, in Sum Duel:

  • I pick 9
  • You pick 3
  • The target becomes 12
  • The player whose turn it is can claim a 12 cell

The interesting part is that your number does not only create your own move. It also controls what your opponent can do next.

That shared constraint is where the strategy lives.

Three modes are live

Sum Duel is the most approachable mode. Active numbers are added together, so the board is easy to read and the tactics are about timing, blocking, and forcing useful totals.

Product Duel makes the board spikier. Multiplication creates repeated targets, unreachable zones, and more dramatic tempo swings.

Fifteen Duel is a smaller puzzle mode using the numbers 1-9. First to claim three numbers that sum to 15 wins. The hidden trick: the eight winning triples are exactly the rows, columns, and diagonals of the 3x3 magic square, so the mode is secretly tic-tac-toe in disguise.

The hardest problem was onboarding

The game logic was not the hard part.

The hard part was getting the rules to click before a new player bounced.

I tried to make the first screen do most of the teaching:

  • Put the board front and center
  • Highlight legal cells so players do not need to calculate every option
  • Keep the first match short with a 5x5 board and connect-four win condition
  • Move deeper strategy notes out of the way until players actually want them

I am still tuning this. If you try the game, the feedback I care about most is:

At what moment did the rules click?

The stack

The app is built with:

  • React + Vite for the browser client
  • Cloudflare Workers for the API surface
  • Durable Objects for real-time multiplayer rooms
  • Cloudflare D1 for daily challenge results and leaderboards

Durable Objects turned out to be a nice fit for this shape of game.

Each room maps to a single object instance. WebSocket connections stay in memory, the room owns the authoritative state, and important state can be persisted without running a separate game server.

For a side project, that tradeoff has been pleasant: small deployment surface, real-time rooms, and no always-on server to babysit.

Try it

No signup, no ads, and it works on mobile:

https://numberduel.mathmindpuzzles.com/

Strategy notes:
https://numberduel.mathmindpuzzles.com/strategy/

Magic square explainer:
https://numberduel.mathmindpuzzles.com/math/magic-square-15/

Feedback is very welcome, especially on first-time clarity and whether the game feels more like a puzzle or a duel.