🡄 Previous

Next 🡆

Contents > Introduction

Input Language

The agent is a device that enters precisely timed input sequences per the instructions of an Input Language (IL) program. Each instruction contains a tetromino type, t∈{T,J,Z,O,S,L,I}, followed by a sequence of moves, m:

t m0 m1 m2 … mN−1

Each element of the sequence, mi, is one of the following.

Note: SEMIHARD_DROP_TO_ROW requires a parameter, the target row, y.

When a tetromino spawns, the agent compares the tetromino type with t. If they match, the agent enters sequence m, and it advances to the next instruction. Otherwise, the agent hard drops the tetromino onto an unbounded pile of discards in column −2, and it stays on the current instruction:

Discards Pile

IL programs direct the agent to assemble structures only in columns ≥ 0.

The way the agent enters moves depends on the mechanics of the Tetris implementation. For instance, to shift left by two columns, the agent may need to press the left button, release the left button, and press the left button again with a particular timing.

In practice, IL programs direct the agent to construct a pile near the origin that progressively grows taller and wider. That being the case, it can work with a Tetris implementation that defines “row infinity” as a finite row whose index increases as a function of the number of spawns. In such an implementation, the agent emulates a semihard drop with a finite number of soft drops.

Since the game denies requests to move a piece into solid cells, the content of the playfield determines where a piece ultimately ends up. For example, in the animation below, the agent attempts to shift the O-tetromino into column 1. The attempt works on the empty playfield on the left, but it fails on the nonempty playfield on the right.

Shift Interruption

In the following example, the agent attempts to drop the O-tetromino onto the floor. Again, the attempt works on the empty playfield on the left, but it fails on the nonempty playfield on the right.

Drop Interruption

An IL program program resembles a tool-assisted speedrun (TAS) recording. Both rely on deterministic responses to precisely timed inputs. But IL supports nondeterministic randomizers because it instructs the agent to wait for spawns and to discard unwanted pieces. And the agent acts as an interpreter between a move sequence and the input requirements of a specific Tetris implementation. Nonetheless, if an implementation employs a seedable pseudorandom number generator, then a TAS recording along with the seed will work just as well.

🡄 Previous

Next 🡆