TETERI
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.
Read next
- Why Play TETERIFree, instant, offline-capable, and it asks nothing of you before you can start. A straight account of what it offers.
- The Four Game ModesMarathon, versus CPU, split-screen and online duels, and what each is actually for.
- Every Control in TETERIThe complete list for keyboard, touch and gamepad, including the ones that are not obvious.
- Playing on a PhoneTwo layouts, two control schemes, and the specific problems that had to be solved to make touch work properly.
- Finesse: Placing Every Piece in the Fewest InputsThere is an optimal number of keypresses for every placement. Using more costs time you need later.
- Counting the Bag: Knowing What Is ComingThe randomiser guarantees each shape once per seven, which makes the unseen pieces deducible rather than merely probable.