"Know the Facts, Do the Math"
A constraint-based math puzzle game that combines trivia knowledge with equation solving. Answer trivia questions by placing numbers from a limited pool into mathematical equations while satisfying column sum constraints.
Landing Page: ๐ Home of Sumwords
Sumwords: ๐ฒ Play Game
- Three Difficulty Levels
- Easy: Addition/subtraction with numbers up to 50, 10 numbers, no decoys
- Medium: Addition/subtraction with numbers up to 100, 12 numbers and 2 decoys
- Hard: All four operators (+, โ, ร, รท) with numbers up to 200, 16 numbers and 6 decoys
- Random Difficulty Mode: Game randomly selects difficulty for variety
- 800 Trivia Questions across 16 diverse categories
- Whole-number answers: Every answer is a whole number from 2 to 400 (at most 3 digits). A bigger figure is asked in thousands or millions, and the question says so
- Constraint-Based Puzzles: Numbers must satisfy both equations AND column totals
- Sports
- History
- Geography
- Pop Culture
- Science
- Movies & TV
- Food & Drink
- Technology
- Games & Literature
- Animals & Nature
- Music
- Space & Astronomy
- Body & Health
- Art & Architecture
- Transportation
- Holidays
Plus an "Everything" category that combines all questions for maximum variety.
- Interactive Tutorial: First-time users see a helpful tutorial explaining gameplay with a "Don't show again" option. Replay it any time from the ๐ How to Play button in the header, which also lists the keyboard controls
- Dark Mode: Toggle between light and dark themes with persistent preference
- Hint System: Every equation has its own Hint button; tap it to choose one of two hints
- Reveal the answer to the trivia question
- Reveal which numbers to place in the equation
- Check an equation's mark (โ Correct or โ) for one hint, without a Submit
- Undo: Take back your last placed or removed number with the Undo button or Ctrl+Z (Cmd+Z on Mac), one move at a time
- Keyboard Play: Play without a mouse: type a number to place it, move between blanks and tiles with the arrow keys, and press Escape to back out one step. Screen reader labels and visible focus rings are included (full list under Keyboard below)
- Smart Resume: Automatically saves progress and offers to resume unfinished puzzles
- Confirm Before Discarding: Reset, New Puzzle and changing the category or difficulty ask first when you have progress on the board
- Submit Feedback: Submit marks every equation and column target so you can see what to fix, without revealing the trivia answer
- Statistics Tracking: Track completed puzzles, attempts, hints used, perfect games, win streaks and stars earned. The current win streak is also always visible as a ๐ฅ chip in the header
- Star Rating: Every win earns 1 to 3 stars from attempts and hints (3 stars is one attempt with no hints), shown on the win panel with how long the puzzle took
- Share Results: After a win, copy a spoiler-free, Wordle-style grid of your attempts, with your star rating, to the clipboard; an equation solved with a hint shows as a yellow square
- Daily Puzzle: One shared puzzle per day (Everything, Medium) from a seeded generator, so everyone gets the same puzzle with no server; play it once per day and share your result as
Daily #2-12 - Mobile-Optimized: Fully responsive design works great on phones and tablets
- Install and Offline: Install Sumwords from your browser and, after one online visit, play offline on every difficulty, including the Daily puzzle (see Install and Offline below)
- Persistent Storage: Game state, preferences, stats, and theme saved locally
- Remembered Choices: Your last category and difficulty are kept between visits. Starting a daily does not change them, and an unreadable saved choice falls back to Sports or Random
- Professional logo and branding
- Dark mode with smooth theme transitions
- Confetti animation on puzzle completion
- Color-coded validation feedback
- Emoji markers show which hints have been used
- Clean, modern interface
Place numbers from the number pool into the equation blanks to make valid equations. The sum of each column must match the target shown at the top.
- Answer the trivia question to learn which number is the solution
- Place numbers from the pool into equation blanks by clicking the pool number, then clicking a blank. Operators are shown in every equation and are never blanks.
- Satisfy constraints:
- Each equation must be mathematically correct
- Column totals must match the targets at the top
- Submit when all blanks are filled. Each equation gets a mark (โ Correct, โ Numbers don't work, โ Answer doesn't fit the question, โฆ Incomplete) and each column target gets a โ or โ. The trivia answer is never shown
- Start by placing the answer to the trivia question
- Work backwards from column totals to narrow down number choices
- Use hints strategically if you get stuck
- โ Check in an equation's Hint row shows its mark without a Submit. It costs one hint, but is free when the equation is incomplete or its mark is already current
- Made a slip? Undo takes back your last placed or removed number. The undo history is kept in memory only, so it starts empty after a page refresh
- Each number can only be used once
- Tab moves between the blanks, the number pool, the answer boxes and the buttons. The pool is a single Tab stop
- Type a number with a blank selected to place the first unused tile with that value. A multi-digit number places when it is unambiguous, on Enter, or after a short pause
- Arrow keys move between the number blanks (and select them), or across the unused tiles when a pool tile is focused
- Enter or Space places the focused pool tile or clears a filled blank; Backspace or Delete clears a filled blank
- Escape cancels one thing at a time: an open hint row, the typed digits, then the selected tile, then the selected blank
- Ctrl+Z (Cmd+Z on Mac) undoes the last placed or removed number, unless a text box has focus. โ Check is in an equation's Hint row and costs one hint
- The ๐ How to Play button in the header replays the tutorial, including this list. It never changes the "Don't show again" setting
- Answer boxes are reached with Tab: type up to 3 digits, and Enter jumps to the next one
- HTML5 - Semantic structure
- CSS3 - Responsive design with CSS custom properties for theming
- Vanilla JavaScript - No frameworks or dependencies
- localStorage API - Persistent data storage for game state and preferences
- Clone the repository
git clone https://github.com/TheBIMsider/sumwords.git
cd sumwords- Open in browser
# Simply open V01/index.html in your web browser
# No build process or dependencies required- Optional: Use a local server
# Python 3
python -m http.server 8000
# Node.js (if you have http-server installed)
npx http-server -p 8000Then navigate to http://localhost:8000/V01/
Sumwords is a Progressive Web App (PWA). You can install it and play without a connection.
- Install: In Chrome, Edge or Android Chrome, use the install prompt or the browser menu (Install app). On iPhone or iPad, open the game in Safari and choose Share > Add to Home Screen.
- Uninstall: On desktop Chrome or Edge, open the installed app, click the three-dot menu in its title bar and choose Uninstall Sumwords (or right-click it at
chrome://appsoredge://apps). On Android, long-press the icon and tap Uninstall. On iPhone or iPad, long-press the icon, then tap Remove App > Delete App. Your saved puzzle and statistics stay in the browser unless you tick the option to also clear site data, or clear them yourself in the browser's site settings. - Offline: After one visit with a connection, the game loads and plays offline on every difficulty, including the Daily puzzle. Each online visit picks up the latest version.
- Shared storage: The installed app and the browser tab use the same saved puzzle, statistics and theme, because they share one address and storage.
- Landing page: The landing page needs a connection. The game's ๐ Home button opens it, so offline it shows the browser's offline page.
- Local files: Opening
index.htmlstraight from disk (file://) still works, but installing and offline play need the game served overhttp://localhostorhttps://.
sumwords/
โโโ V01/
โ โโโ index.html # Game HTML structure
โ โโโ styles.css # Game styling with dark mode
โ โโโ questions.js # 800 trivia questions (questionBanks), loaded before game.js
โ โโโ game.js # Game logic
โ โโโ sw.js # Service worker for offline play
โ โโโ manifest.webmanifest # App name, colours and icons for install
โ โโโ icons/ # App icons (192, 512, maskable 512, Apple 180)
โ โโโ Sumwords_Logo.png # Game logo
โ โโโ README.md # Copy of this README for the game folder
โโโ landing/
โ โโโ index.html # Landing page HTML
โ โโโ styles.css # Landing page styling with dark mode
โ โโโ script.js # Landing page theme switcher
โ โโโ Sumwords_Logo.png # Landing page logo
โ โโโ Sumwords_in_Action.png # Landing page screenshot
โโโ tests/
โ โโโ daily.test.js # Checks the daily puzzle: same date same puzzle, numbering, share header and daily stats
โ โโโ feedback.test.js # Checks the Submit mark for each equation and that no trivia answer is printed
โ โโโ generator.test.js # Checks every generated puzzle is solvable, plus question bank rules
โ โโโ hints.test.js # Checks every equation has its Hint button and choice row, and old hint code is gone
โ โโโ keyboard.test.js # Checks keyboard play: typed numbers, arrow keys, Enter/Space, Backspace/Delete and Escape
โ โโโ play-polish.test.js # Checks the Reset/New Puzzle confirm rules and auto-advance lookup
โ โโโ preferences.test.js # Checks the remembered category and difficulty: bad saved values fall back per field
โ โโโ pwa.test.js # Checks the manifest, icon sizes, service worker cache list and install wiring
โ โโโ tutorial.test.js # Checks the How to Play button, tutorial dialog markup and that replay never sets the seen flag
โ โโโ scoring.test.js # Checks the star rating, the star tally in the statistics and the play time clock
โ โโโ share.test.js # Checks the share text and per-attempt results
โ โโโ streak.test.js # Checks the header streak chip: placement, saved streak read, label and refresh call sites
โ โโโ undo.test.js # Checks the Undo move history, the Check mark and when Check costs a hint
โ โโโ validation.test.js # Checks Submit validation messages
โโโ README.md # This file
โโโ LICENSE # BSD 3-Clause License
- Questions are randomly selected from the chosen category
- Equations are generated using a "from" approach (targets calculated from equations)
- Number pools hold the two operands of every equation (the trivia answer is typed into its own blank)
- Decoy numbers (Medium/Hard) are extra pool numbers that belong to no equation, adding strategic complexity
Every level has 5 equations. Operators are always visible.
- Easy: Numbers up to 50, addition/subtraction only, 10 numbers in a 5ร2 pool grid, no decoys
- Medium: Numbers up to 100, addition/subtraction only, 12 numbers (2 decoys) in a 6ร2 pool grid (3ร4 mobile)
- Hard: Numbers up to 200, all operators (+, โ, ร, รท), 16 numbers (6 decoys) in an 8ร2 pool grid (4ร4 mobile)
Difficulty is the math, not the trivia. A level changes the operators, number range and decoys, not the questions: any question can appear on any level.
The ๐ Daily button in the header loads one puzzle per calendar day. Everyone who plays on the same date gets the same puzzle, with no server: the puzzle is built from a seed made from the date, so every device builds the same questions and numbers (the order of the tiles in the pool may differ).
- Always Everything and Medium; the category and difficulty selectors are locked while a daily is loaded
- Uses the player's local date, and is playable once per day. After a win the Daily button shows your result, Share result and "Next daily puzzle tomorrow"
- Numbered
series-day, for example#2-12. The series number only goes up when a change alters the dailies (new questions or a generator change), and the day count starts again at 1 - Share text header is
Sumwords v1.3.0 ยท Daily #2-12; the rest is the usual spoiler-free grid - A daily win counts as a normal Medium win and also shows in the Daily Puzzles block in Stats (there is no separate daily streak)
Every win earns 1 to 3 stars, worked out from the attempts (Submit presses) and hints it took. An extra attempt costs 2 points and each hint costs 1:
| Points lost | Stars | Word |
|---|---|---|
| 0 (one attempt, no hints) | โญโญโญ | Perfect! |
| 1 to 3 | โญโญ | Nice work! |
| 4 or more | โญ | Solved! |
- Only a perfect game earns 3 stars, and any win earns at least 1
- The win panel shows the stars, a one-word label and the time the puzzle took, for example
โญโญโญ Perfect!above1 attempt ยท 0 hints ยท Time 2:41 ยท Win streak: 4 - Time counts only while the puzzle is on screen and the tab is visible, and Reset starts it over. It is shown but not scored, and it is not in the share text
- The second line of the share text ends with your stars, for example
2 attempts ยท 1 hint โญโญ - The rating is worked out from attempts and hints each time and is never saved
The game tracks comprehensive statistics including:
- Total puzzles completed
- Total attempts
- Hints used
- Perfect games (one attempt, no hints, which is also 3 stars)
- Stars earned (wins at 1, 2 and 3 stars, counted from the version that added stars)
- Current and best win streaks (the current streak is also always shown as a ๐ฅ chip in the game header)
- Per-difficulty breakdowns
- Daily puzzle totals (completed, attempts, hints, perfect games, average attempts)
Contributions are welcome! This is a personal learning project, but feel free to:
- Report bugs via GitHub Issues
- Suggest new features
- Submit pull requests for improvements
- Add new trivia questions
Questions are stored in V01/questions.js in the questionBanks object, one array per category (sports, history, geography, popculture, science, moviestv, fooddrink, technology, gamesliterature, animalsnature, music, spaceastronomy, bodyhealth, artarchitecture, transportation, holidays). Each question needs:
question: The trivia question textanswer: Whole number answer. The existing bank uses answers from 2 to 400; the rules are enforced bytests/generator.test.js
Add it to the array for its category. Example, added to science:
{ question: 'Bones in the adult human body', answer: 206 },This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Copyright ยฉ 2026 Carl Storms (The BIMsider)
Carl Storms (The BIMsider) With the help of his AI Buddy ๐ค Claude Code
- Role: Technical Success Manager, AECO Software
- Experience: 25+ years in AECO technology and BIM
- Project Start: December 25, 2025
- Inspired by constraint-based puzzle games
- Built with vanilla JavaScript for maximum maintainability
- Designed mobile-first for modern web users
- 21 development sessions documented from concept to deployment
This project was developed (Vibe Coded) over 21 sessions with Claude Chat and continues in Claude Code:
- Automated tests check that every generated puzzle is solvable and that Submit validation behaves
- Question bank fact-checked and kept within the generator's answer rules
- Beginner-friendly code for long-term maintainability
- Systematic testing and bug fixes
- CSS variable architecture for maintainable theming
- Core game mechanics
- Three difficulty levels plus random mode
- 800 trivia questions across 16 categories (Music, Space & Astronomy, Body & Health, Art & Architecture, Transportation, Holidays added)
- Hint system with two hint types (answer and numbers)
- localStorage persistence
- Statistics tracking
- Mobile-responsive design
- Cross-browser compatibility
- Professional logo and branding
- Dark mode with theme toggle
- Landing page with animations
- Interactive tutorial for first-time users
- v1.1.0: 5 equations and visible operators on every level, audited question bank, automated puzzle and validation tests, version shown in the game
- Share results: win panel with a spoiler-free, Wordle-style grid copied to the clipboard
- Daily puzzle: one shared puzzle per day from a seeded generator, with a daily number, finished-result view and daily statistics
- Star rating and play time: 1 to 3 stars per win, play time on the win panel, stars in the share text and a star tally in the statistics
- v1.2.0: daily puzzle, per-equation Hint button, share results with yellow hint squares, Submit feedback marks, star rating and play time, confirm before discarding progress, sticky number pool and column targets
- v1.3.0: keyboard play and screen reader support (type a number to place it, arrow keys between blanks and tiles, Escape backs out one step, visible focus rings), Undo and Check, a replayable How to Play with keyboard controls, six new categories (800 questions in 16 categories), installable offline play, and daily numbering restarts at
#2-1
- Sound effects (optional)
- Leaderboards
- Advanced tutorial with interactive walkthrough
Enjoy playing Sumwords! ๐ฎ๐งฎ
If you find a bug or have suggestions, please open an issue on GitHub.
