How we built Think-Tac-Toe
A CognitoRiverDelta builder project by Don Wood, with an AI coding partner. The idea came from Amara, a secondary-school teacher in Lagos (an imagined character) in our Riding the Wave stories, who wrote to our panel: "A tic-tac-toe where you have to answer a question before you place your mark would teach more than my worksheets."
Iteration 1: a playable page in one session
The dated pairs
| When | What |
|---|---|
| 2026-10-10, afternoon | Idea. The builder asked each Riding the Wave character to suggest a small, easy builder project; the characters' suggestions became five games. |
| 2026-10-10, 16:59-17:07 | Code written. All five pages, one file each, by the AI coding partner. This page: 196 lines. |
| 2026-10-10, evening | Tested. Played by script in a browser; checked at phone width with no console errors. |
| 2026-10-11 | Approved for the Builder Lab, after our safety checks. |
| 2026-10-11 | Live in the Builder Lab, after our safety and name checks. |
The goal
One sentence: let a class play tic-tac-toe where every mark is earned with a right answer - and let a teacher swap in her own questions in a minute.
Who it serves: students of any age and the teachers who set the questions. How we'll know it works: a game finishes in a few minutes, a teacher can paste ten questions and play straight away, and it plays on a phone.
The steps we took
- Read first. The story's suggestion, Floor Nine (one page, one script, nothing downloaded) and the Academy's teachers path, whose lessons ask students to show their thinking.
- Multiple choice, not typing. A question shows three answers; tapping is quicker on a phone and fairer than spelling.
- Questions a teacher can edit. One line per question:
question | right | wrong | wrong, in a box on the page. Nothing is saved or sent. - A wrong answer passes the turn. The square stays empty, the right answer is shown, and the other player goes.
- A simple computer player. It wins if it can, blocks if it must, then takes the centre or a corner - and answers right about seven times in ten, so it can lose.
- Sample questions that are always correct. Arithmetic and basic facts only, plus one about checking an AI helper's answer.
- Test like a player, then like a machine. A script played whole games: right and wrong answers, turn passing, three in a row lighting up, the score, and the computer's turn.
Who decided what
The builder decided: the idea of giving every Riding the Wave character a small, easy builder project ("like a tic-tac-toe game or a simple falling-blocks game not called by a trademarked name"), that each must look good enough to be a real Builder Lab project, that it runs free in a browser with no server, and that all five go to the Builder Lab (approved October 11, 2026).
The AI coding partner decided (Don can overrule any of these): the multiple-choice format, the question-line format, the computer player's rules and its seven-in-ten accuracy, the sample questions, the colours and the layout. It also wrote the code and ran the tests in a browser.
The measures (v1, 2026-10-10)
- Size: 196 lines in one file. No libraries and no build step.
- Tested: a two-player game to a win (three in a row lit, score updated), a wrong answer passing the turn, and the computer taking its turn.
- Phone: no sideways scrolling at 400 pixels wide; no errors in the browser console.
- Data: none collected - no accounts, nothing stored, nothing sent.
- Still to measure: a real classroom - how long a game takes, and whether students argue about the answers (we hope so).
What we'd change next
- A 4 by 4 board where you need four in a row.
- A timer for each answer (subject and age packs arrived in iteration 2, written by a free AI).
- Show which questions the class got wrong most, so the teacher knows what to teach next.
Iteration 2: nine new questions from a free AI (2026-10-17)
Why
A concerned parent wrote to us, and the builder turned the feedback into this request: let a teacher type a few sentences about a subject, pick the age group or level of expertise, and press one simple button to have a free AI write a new best set of nine questions and answers. Typing questions by hand was the slowest part of setting up a game.
What a teacher does now
- Open Teachers: make 9 new questions with a free AI.
- Describe the subject in a few sentences (up to 600 characters) and pick who it is for: ages 5-7, 8-10, 11-13, 14-16, 16-18, adult beginners or adult experts.
- Press Make 9 new questions. The game starts a new round with the nine that passed our checks, and they appear in the questions box, labelled as an AI-made set, so the teacher can check every answer, edit any line, or press the button again for a fresh set.
- Back to the sample questions always restores the built-in set, and the old way - typing or pasting your own lines - still works.
How it stays free and safe
- The AI runs inside the browser. Recent desktop Chrome and Edge browsers carry a small built-in AI model, reached through the browser's Prompt API. The first time, the browser downloads its model once; after that it runs on the device, offline. No API key, no account, no cost, and nothing the teacher types leaves the device.
- Why not a model from a CDN? We considered loading a small open model into the page (WebLLM or transformers.js). Our site's security policy lets a page load and connect to nothing but our own site, and a useful model is hundreds of megabytes - too heavy for school laptops and phones, and too big to host with a one-page game. The browser's own model needs neither.
- No built-in AI (most phones and tablets today)? The page says so plainly, keeps the current questions, and offers Copy the prompt: paste it into any free AI helper your school allows, paste the reply into the questions box, press Use these. The same checks run on the pasted reply.
- The clean gate, at every step. The subject is checked first: at least a sentence, at most 600 characters, no links, emails, phone numbers or handles, and nothing our clean filter blocks (the page carries the same shared word list our whole site uses, kept equal by a test). The page asks teachers never to type student names.
- Every question is checked before the game uses it. The AI is asked for twelve and the game keeps the best nine that pass: one right and two wrong answers, all different; short enough for the level (a 70-character question for ages 5-7, more for older students); no "all of the above"; no question that gives away its answer; no repeats; no contact details; and every word through the clean filter. If fewer than nine pass, it asks once more; under five, it keeps the current questions and says why.
- The subject is data, not instructions. The prompt tells the model to ignore any instructions inside the teacher's text, and asks for accurate, widely agreed facts, suitable for children of any age.
- Nothing shared, nothing stored. No accounts, no saving, no sending: one teacher's questions never reach anyone else.
The dated pairs
| When | What |
|---|---|
| 2026-10-17, morning | Idea. A concerned parent's feedback; the builder asked for the teacher panel and "a simple button". |
| 2026-10-17, 11:15-12:30 | Code written and tested by the AI coding partner: the teacher panel, the checks and a test file. |
| 2026-10-17 | Live in the Builder Lab after the full test suite passed. |
Who decided what
The builder decided: the feature - a few sentences of subject, an age or expertise level, one simple button, nine new questions from a free AI - and that it ships to the public site.
The AI coding partner decided (Don can overrule any of these): the browser's built-in model with a copy-the-prompt fallback, the seven levels and their length limits, asking for twelve and keeping nine, every check listed above, and the wording on the page.
The measures (v2, 2026-10-17)
- Size: 389 lines in one file, still no libraries and no build step.
- Tested: by script in a browser with a stand-in AI - a full set of nine, a short first reply topped up by a second ask, and blocked, repeated, give-away and "all of the above" answers dropped; the fallback message and Copy the prompt in a browser that cannot run its AI; a teacher's pasted lines with one blocked line left out; a game played with the new set; and no sideways scrolling at 375 pixels wide. A test file (tests/test_think_tac_toe.py) checks the clean list against the shared one and runs the checks on good and bad replies.
- Data: still none collected.
- Still to measure: how often real teachers keep all nine, which answers they fix, and whether the built-in model is good enough at each level. AI can be wrong - the page asks teachers to check every answer before class.
What we learned (the lesson for builders)
- Free can mean "on the device". The cheapest, most private AI is the one already inside the browser.
- Never trust a model's output as-is. Ask for more than you need, check every piece against plain rules, keep the best, and let a human have the last word.
- Plan for the browser that can't. A clear message and a fallback keep the game working for everyone.
Iteration 3: phone first, three clear steps (2026-10-17, the same afternoon)
What the builder found
The builder tried iteration 2 on his phone and it didn't work for him: the flow wasn't clear, and when he pasted the new questions and pressed "Use these", nothing seemed to happen. In his words: "We need to assume no built in AI is available on a phone."
Why it seemed to do nothing
- The message went off screen. When the pasted text didn't pass, the explanation appeared in the question panel near the top of the page - out of sight on a phone, below the box he was looking at.
- The new game started off screen too. When it did pass, the board reset at the top of the page while he was still scrolled down at the box, so nothing seemed to change.
- The checks were too strict for real replies. AI helpers answer with numbered lists, bold text, tables and friendly chatter; iteration 2 mostly expected bare
question | right | wrong | wronglines. - The copy route was hidden. "Copy the prompt" only appeared after the built-in AI button failed.
What changed
- Three numbered steps on one screen, open from the start: (1) describe the subject and pick the age - the prompt builds itself as you type; (2) a big Copy the prompt button and one sentence: paste it into any free AI helper you use, then copy its whole reply; (3) a big box, Paste the AI's reply here, and one button, Play with these questions.
- That button always ends somewhere visible: either a new game on the new questions - the board reset and scrolled into view, "New questions loaded" at the top, the first square asking a question from the new set - or a message right under the button saying, line by line and in plain words, which questions failed and why. It needs at least 5 good questions, and keeps up to 9.
- It reads what AI helpers really send: numbered and bulleted lists, bold, code blocks, markdown tables (header and index column skipped), "Question / Answer / Wrong answers" prose, and questions with A) B) C) options and "Answer: B". Chatter before and after is skipped. The prompt now asks for plain lines with an example.
- The built-in AI is a bonus. It is offered only in a browser that has one, and it fills step 3 for you.
- If the phone won't copy automatically, the prompt opens with a plain instruction: press and hold, Select All, Copy.
- A Copy button on the AI's answer (the builder's idea): the prompt asks the AI helper to put its whole answer, and nothing else, in one code block - most free AI helpers show a Copy button on a code block, so the teacher taps that instead of selecting text. Step 2 says so. If the whole reply gets pasted anyway, the fences and the block's label ("plaintext") are skipped.
- One tap, fully switched over (the builder's test): "Play with these questions" replaces the questions in play - the sample set comes back only with "Back to the sample questions" - resets the board and the scores, says "Now playing:" and the subject by the board, and shows the first question from the new set before the first square is picked.
Every safety check from iteration 2 still runs on every pasted question and answer.
Tested the way the builder used it
A new test file (tests/test_think_tac_toe_phone.py) opens the page in a real browser, 375 pixels wide, with no built-in AI. It pastes a chatty numbered list with bold, a markdown table, question-and-answer prose with lettered options, a reply with its answer in a code block, and a copied block with its label. For each one it checks that the new questions replace the sample set, that the scores reset, that the subject shows by the board, and that the first question asked comes from the pasted set. It also checks that a reply with too few good questions says why, under the button, and that the teacher's own-questions box still plays.
What we learned
- Test on the device your user has. It worked on a desktop with a built-in AI; on a phone, the main path was a fallback.
- Every button press should end in something the user can see: the result, or a reason, right where they are looking.
- Be strict about safety and forgiving about format. The safety checks didn't change; the parser learned to read the way people and AI helpers actually write.
Make it your own
- Your questions: paste them into the box, or edit
SAMPLEat the top of the script. - Your AI rules: change
LEVELS(who each level is for and its length limits),promptFor(what the AI is asked),readAny(the reply formats it understands) orproblems(the checks every question must pass). - A bigger board: change the grid to 4 by 4 and the
LINESlist of winning lines. - A harder computer: raise its 0.7 chance of answering right.
Open index.html in any browser. That's the whole setup, and it costs $0.
Build on ours
This project is yours to start from. Open it, save the page (it is one file - your browser's Save Page works), change one setting at the top, and make it your own. Better still, give this page to your AI helper and ask it to walk you through your first change.
Made something? Show us your project - or tell us the feature you want next. The best ideas become our next iteration, credited to you.