Playing TETERI

It Is Open Source, and What That Means Here

MIT licensed, no dependencies at all, and a test suite you can run yourself.

The entire game is published on GitHub under the MIT licence. You can read it, run it, modify it, and use it in your own projects commercially, provided the copyright notice travels with it.

What is in the repository

Everything. The game, the stylesheet, the content on this site, the build script that generates these pages, the test suite and the CI configuration. There is no private build step and no obfuscated bundle.

No dependencies

This is worth emphasising because it is unusual. The game has no dependencies: no engine, no framework, no library, not even a build tool for the game itself. It is a handful of JavaScript modules the browser loads directly.

That means you can clone it, serve the directory over HTTP, and it runs. There is nothing to install first.

The tests

The rules engine, the versus maths, the gesture recognition and the CPU opponent are all free of DOM dependencies, so they run headless. The suite covers rotation and kick tables, the seven-bag's distribution, every scoring path, garbage and cancelling, snapshot round-tripping, match orchestration and the CPU's board evaluation.

Continuous integration runs it on two Node versions and checks that every shipped module is precached by the service worker.

Why it is worth reading

If you want to know how something works, such as how T-spins are detected, how the soundtrack is synthesised, or how two browsers find each other, the answer is in a file you can open, and the files are small enough to read in an afternoon.

The How TETERI is built section walks through the interesting parts.

Contributing

Issues and pull requests are welcome. If something on this site is wrong, that is the place to say so.

PLAY TETERI ALL ARTICLES