Back to Games
The Math Dilemma screenshot

The Math Dilemma

300 math problems. One pirate teacher. Two kids. And a secret weapon made of code.

story · easy · solo · 10m+

About This Game

I love this story because it answers the question every kid asks: why do I need to learn math? The answer, in this case, is to survive Mr. Sterling's class. He's a math teacher who assigns 300 problems a night. Then 600. The kids fight back the only way they know how. They build software. It's basically a revenge story with variables.

The coding lesson here is about using JavaScript to do math. Variables. Numbers. Multiplication. You store a radius, multiply it by pi, and get a circumference. That's it. But here's the thing — once you realize a computer can do math for you, instantly, with perfect accuracy, something clicks. Computers are calculators that never get tired. You just have to tell them what to calculate. That's what variables are for.

I snuck a real lesson inside the fun. The formula for circumference is 2 times pi times the radius. You could look that up. But when you type it into the code editor and see the number come out the other end? That's different. That's you telling a machine what to do and watching it obey. First time I did that, I felt like a wizard. Still do, honestly. Every single time. I'm forty-seven years old and I still get a little thrill when a program runs correctly. I should probably go outside more.

The story is ridiculous on purpose. Pirate teachers. Math mutiny. A fist bump at the end. I wanted it to feel like a movie. Because if a kid remembers the story, they'll remember the code. That's the trick. You don't teach someone to code. You trick them into wanting to learn. Then you get out of the way.

How to Play

Controls Read, type code, click Run

Read the story. Laugh at Mr. Sterling. When you get to the code section, try the math in the editor. Change the radius. Try different formulas. What's the area of a circle? The volume of a sphere? If you don't remember the formulas, look them up. That's what programmers do. We look things up constantly. It's not cheating. It's the job.

Game Details

Genrestory
Difficultyeasy
Playerssolo
Session Length10m+
Inputkeyboard
storycodingJavaScriptmathvariablesbeginner
Carl

Mr. Sterling is based on a real teacher. Sort of. The homework was definitely real. The trauma lingers.

Play The Math Dilemma Now