DEV Community

zqp520code
zqp520code

Posted on

MathLab: Learn High-School Math by Playing with Graphs

MathLab: Learn High-School Math by Playing with Graphs

I built MathLab for high-school students who get stuck staring at a final answer without understanding how it got there. Instead of showing only answers, MathLab walks through every step — and lets you grab the math with your hands.

This post was written as part of the Kiroween 2026 hackathon.

Try it live: https://zqp520code.github.io/mathlab/
Source code: https://github.com/zqp520code/mathlab
Demo video: https://www.youtube.com/watch?v=MXColUWJw4E

What it does

MathLab is a single-page web app with four hands-on modules, all in Chinese:

1. Algebra — solving quadratic equations, step by step.
Take x² − 5x + 6 = 0. MathLab shows all five steps, explains why each transformation is valid, and lets you step forward and backward. Change a coefficient and it recalculates immediately — the discriminant, the roots (here 3 and 2), everything updates.

2. Geometry — drag a triangle, watch the numbers follow.
Drag a vertex of a 6-8-10 right triangle and the side lengths, angles and area change in real time. The Pythagorean theorem stops being a formula to memorize and becomes something you can see.

3. Functions — slide the parameters, watch the parabola move.
Drag the sliders for a, b and c and the quadratic graph reshapes live, with the vertex and axis of symmetry marked. Slide a to −2.1 and the parabola flips over in front of your eyes.

4. Quiz — instant feedback, not just a red X.
Twelve questions across the modules. Get one wrong and MathLab tells you which step went wrong; options lock after you answer and your progress is tracked.

Everything runs as a static page — no backend, no API keys, no build step — and it works on a phone as well as a desktop.

How I built it with Kiro

I built MathLab with Kiro's spec-driven workflow, and the specs are part of the repo — you can read them at .kiro/specs/math-tutor/:

  • requirements.md — what each of the four modules must do
  • design.md — page structure and interaction design
  • tasks.md — the build broken into small tasks, with a Nov 27 → Dec 4 schedule

The workflow was: write the spec first, then implement module by module (algebra and functions over the Nov 28–29 weekend, geometry and the quiz on Nov 27), then test on desktop on Nov 30 and on a real phone on Dec 1. The 4,000 Kiroween credits were redeemed on Nov 29 and funded the final stretch.

What I learned

The biggest lesson was about scope: a hackathon project that tries to cover everything ends up demonstrating nothing. Betting on four small, visual, touchable interactions — one equation, one triangle, one parabola, one quiz — made the app testable in 30 seconds: a stranger opening the page can tell within half a minute what it is, who it is for, and why it matters. Steps matter more than answers, and that turned out to be a product decision, not just a teaching slogan.

What's next

The demo video and the Devpost submission go out with this post. After Kiroween, the next step is more quiz coverage — three to five questions per module instead of a shared set — and a version teachers can use in class.


Built with Kiro (spec-driven development), HTML, CSS, JavaScript, Canvas/SVG. Demo video: https://www.youtube.com/watch?v=MXColUWJw4E

Top comments (0)