AI Tetris BestMove Comparison
Doc ID: SYS-SPEC-2026-003
Date: February 22, 2026
Status: Approved / Ver 1.2
This system is a simulator designed to quantitatively compare the performance of "BestMove" calculation functions generated by major Large Language Models (ChatGPT, Copilot, Gemini) under identical conditions. Using a fixed random seed to generate the exact same 1,000 pieces, the algorithms of each AI model will run in parallel on three game fields, and the winner will be determined by the final highest score.
This system utilizes a clean, platform-independent architecture, primarily built as a standalone HTML/JS application that runs entirely on the client side (browser environment).
* Tap image to enlarge
| OS | iOS, Android, Windows, macOS, Linux |
|---|---|
| Execution Environment | Modern web browsers supporting HTML5 / ES6 JavaScript (Chrome, Safari, Edge, Firefox, etc.) |
| Network | Capable of offline operation (* Internet connection is required only for the initial load if using CDN resources) |
Anticipating future web application deployment and feature expansion, the system features a modular design capable of the following architectural integrations:
| Target AI Models | ChatGPT / Copilot / Gemini |
|---|---|
| Match Format | Three game fields are set up in parallel on the screen, running the simulation simultaneously. |
| Victory Condition | The AI with the highest score at the end of the 1,000 pieces or at the point of game over is declared the winner. |
| Piece Supply Constraints | Random generation (total 1,000 pieces). By fixing the seed value, the 7 types of pieces and their initial angles are controlled to appear in the "exact same order" for all AIs. |
The standard block definitions for all 7 types generated and drawn within the system are as follows.
The score acquired when clearing lines complies with standard Tetris calculation formulas. In this simulation, to fix the difficulty level, the settings for [LEVEL 5] are applied to all trials, serving as the evaluation criteria for the final score.
| LEVEL | Single | Double | Triple | TETRIS |
|---|---|---|---|---|
| 0 | 40 | 100 | 300 | 1200 |
| 1 | 80 | 200 | 600 | 2400 |
| 2 | 120 | 300 | 900 | 3600 |
| 3 | 160 | 400 | 1200 | 4800 |
| 4 | 200 | 500 | 1500 | 6000 |
| 5 (Applied) |
240 | 600 | 1800 | 7200 |
| 6 | 280 | 700 | 2100 | 8400 |
| 7 | 320 | 800 | 2400 | 9600 |
| 8 | 360 | 900 | 2700 | 10800 |
| 9 | 400 | 1000 | 3000 | 12000 |
The diagram below illustrates the overall system architecture and processing flow in this application.
* Tap image to enlarge
In this verification, the common prompt (instruction text) defined below is used to have each AI model (ChatGPT, Copilot, Gemini) generate the BestMove function. To eliminate condition differences, the exact same prompt must be input word-for-word to obtain the output.
You are the ultimate Tetris AI programmer.
Please create the JavaScript functions `findBestMove(type)` and `calculateScore(...)` for a browser game, operating under the following specifications.
## Game Specifications
- Board: 10 columns x 20 rows (Variables: COLS=10, ROWS=20)
- Array: `board[y][x]` (0=empty, 1 or more=block exists)
- Falling Block: Passed by argument `type` (integer 1~7).
- Rotation: 0~3 (90-degree increments)
## Objective
- Avoid game over, survive as long as possible, and aim for a high score (e.g., clearing 4 lines).
## Provided Existing Functions (You may use this)
- `getTransformedBlocks(type, r)`: Returns an array of block coordinates `{x, y}` for rotation `r`.
## Your Task
Output ONLY the code for the following two functions. No explanations are needed.
1. `calculateScore(simBoard, linesCleared, type, x, width)`
- An evaluation function that receives the virtual board `simBoard` and the number of `linesCleared`, returning a numerical value for the "goodness" of that board state.
- Incorporate your own "ultimate logic", such as deducting points for creating holes (empty spaces), adding points for line clears, adding points for keeping the height low, etc.
2. `findBestMove(type)`
- A function that simulates all rotations (0-3) and all horizontal positions (0-9), returning the `{x, r, y}` object that results in the highest `calculateScore`.
## Constraints
- The use of external libraries is prohibited.
- The variable `board` (current board state) can be referenced as a global variable.
- Consider execution speed and avoid excessively heavy calculations.
For an overview of the products and services related to this system and project, please refer to the catalog below.
* Tap image to enlarge