Tilemma

Slide tiles. Prove it.

Visit Repo
Tilemma banner

About

## The problem it solves

Proofs are hard to get into. The syntax is unfamiliar, the type checker is strict, and the error messages talk about symbols instead of ideas. Functional programming has a similar problem. Things like pure functions, folds and higher-order functions are easy to read about and hard to feel.

Tilemma tries to make both of them something you can see and touch. Every move you type changes the board right away, so you watch the proof happen. Each of the 12 levels teaches one idea, starting with a single swap and ending with a boss level that uses locked blocks, helper functions and List.map. From level 8 you write your own helpers, like a function that turns a block three times to make a counter-clockwise rotation, and you learn to shorten your solution by composing them.

When a move breaks a rule, the exact block turns red and the game tells you why, in plain English. When you want to know if it is all real, "Show Lean" opens the actual file that was checked. Nothing is faked.

It is for students meeting a proof assistant for the first time, for teachers who want a gentle way into proofs and programs, and for anyone curious how this kind of tool works.

## Challenges we ran into

Running text from strangers through a compiler. Lean can run code while it compiles, so anything a player types has to be treated as dangerous. We only let a strict list of allowed commands through, we put the player's text into a fixed Lean template, and we block sorry. We also added time limits, memory limits and rate limits, and the server checks that the finished proof does not depend on any hidden assumptions.

Speed. Starting Lean for every check took about 1.6 seconds, which feels terrible in a game. We switched to Lean workers that stay running with the library already loaded, and a check now takes around 50 milliseconds. If those workers are not ready yet, the server falls back to the slow way and switches back on its own.

Making sure a bug can't give a fake win. Our tactics only suggest the next board. The Lean kernel then recomputes every step itself. That means a bug in our code can wrongly reject a good proof, but it can never accept a bad one. We tested this by writing a tactic that cheats on purpose and confirmed the kernel rejected it.

Keeping two versions of the rules in sync. To make the board update instantly while you type, we have a TypeScript copy of the rules in the browser. Lean always has the final say. To make sure the two agree, we wrote property-based tests based on the same laws we prove in Lean, and a test that runs the same proofs through both versions and compares the results.

Turning compiler messages into a game. Lean's error messages are written for people reading code. We had to work out which line, which editor pane and which blocks each message was about, so the right tile could light up.

A bug that only showed up on the live site. Show Lean worked on our machines but was empty for visitors, because the production server does not send the generated file back. We fixed it by rebuilding the file in the browser with the same function the server uses. That only works because the function has no side effects, which was a nice reminder of why we built it that way.

Screenshots

Tilemma screenshot 1Tilemma screenshot 2Tilemma screenshot 3Tilemma screenshot 4

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.