{"slug": "i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong", "title": "I built a sudoku app where the AI coach is never allowed to be wrong", "summary": "A developer built Kodiak Sudoku, a sudoku app whose AI coach is architecturally prevented from suggesting incorrect digits, with every proposed move validated against a solver before it reaches the player. The app uses Uint16Array bitmasks for candidate notes, keeps solutions server-side so the daily leaderboard cannot be cheated, and ships 15 verified technique lessons alongside the game. The stack is Next.js 15, React 19, Supabase, Drizzle, Zustand and Zod on Vercel, with puzzles drawn from a 3-million-puzzle rated dataset.", "body_md": "I play sudoku most mornings. Every app I tried was either slow to enter digits, covered in ads, or both. So I built [Kodiak Sudoku](https://kodiaksudoku.com), and along the way I ran into three problems that turned out more interesting than I expected.\n\nA sudoku board is 81 cells, each with up to 9 pencil marks. If typing a digit rerenders the whole grid, you feel it, especially on a cheap phone.\n\nWhat worked:\n\n`Uint16Array`. Bit 3 set means \"3 is a candidate\". Toggling a note is one XOR, and comparing two cells' notes is one integer compare, which makes the memoized cell comparator trivial.\n\n```\n// toggle candidate d (1-9) in cell i\nnotes[i] ^= 1 << d;\n\n// is d a candidate?\nconst has = (notes[i] & (1 << d)) !== 0;\n```\n\nThe daily puzzle has a leaderboard, and a leaderboard is only worth anything if it's honest. The rule I set early: **the solution never reaches the browser.**\n\nHints are allowed on the daily, and the board shows how many each player used. That turned out fairer than banning them. There are now weekly, monthly and all-time standings too, ranked by dailies solved and then average time.\n\nThis was the part I was most nervous about. I wanted a coach that looks at your actual board and says something like \"look at box 5, the 4 can only go in two cells\". Language models are good at that kind of explanation. They are also very good at confidently suggesting a digit that's wrong.\n\nA wrong digit on someone's board is the worst possible failure. It's silent, and it breaks trust in everything else. So the design is:\n\nThe validation function is the most heavily tested code in the project. Rejected moves are logged, so I can see if a model update starts guessing more.\n\nThe coach works best when the player knows the vocabulary, so I added a Technique Journey: 15 short lessons from naked singles to swordfish. Each lesson is a real, verified puzzle you solve in place, and the same boards show up inside the [blog posts](https://kodiaksudoku.com/blog), so you can try an [x-wing](https://kodiaksudoku.com/blog/x-wing-sudoku) right next to the explanation.\n\nNext.js 15 (App Router), React 19, Supabase for Postgres and auth, Drizzle with hand-written SQL migrations, Zustand, Zod at every server boundary. Hosted on Vercel. Payments are Stripe Checkout called with plain `fetch`, no SDK. Puzzles come from a public dataset of 3 million rated sudokus, bucketed into four difficulty levels, and every one is checked by the solver for a unique solution.\n\nThe game, the daily, the leaderboards and the lessons are free with no ads. Kodiak Plus adds the AI coach, AI post-game debriefs and unlimited quick play. Everyone else still gets solver-based hints. There's also an Android app.\n\nIf you play, I'd love to hear how the keyboard controls feel and whether Hard is actually hard. The daily puzzle resets at midnight UTC.", "url": "https://wpnews.pro/news/i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong", "canonical_source": "https://dev.to/raz_chiriac_b5dbbe8de7932/i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong-3g03", "published_at": "2026-10-05 14:43:21+00:00", "updated_at": "2026-10-05 14:47:51.121905+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-products", "large-language-models", "ai-tools"], "entities": ["Kodiak Sudoku", "Next.js", "React", "Supabase", "Drizzle", "Zustand", "Zod", "Vercel"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong", "markdown": "https://wpnews.pro/news/i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong.md", "text": "https://wpnews.pro/news/i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong.txt", "jsonld": "https://wpnews.pro/news/i-built-a-sudoku-app-where-the-ai-coach-is-never-allowed-to-be-wrong.jsonld"}}