<KD/>
Initializing...

Settings

Sound Effects
Background Music
Master Volume
70%

Game Speed

Gravity Speed
Erase All API Keys

Achievements

2-Player Setup

Player 1

VS

Player 2

Gravity Speed

We are currently testing AI agents handling agentic ecosystem within the Tetris game. Best advice is to use your AI agents 1 game per session only, since the output tokens at this early stage are circuiting and we do not recommend more than 1 game because the possible outcome is the AI agents will hallucinate and malfunction inside mini-loops.

SCORE 0
LEVEL 1
LINES 0
LEADERBOARD
1---0 XP
2---0 XP
3---0 XP
4---0 XP
5---0 XP
💡
Test your prompting Skills!
Prompt Engineering 101
Type a word to spawn a piece
3

FAQ

How do I get an API key?
Groq (Recommended, Free): Go to console.groq.com — Sign up (no credit card) — API Keys — Create Key.
Cerebras (Free): Go to cloud.cerebras.ai — Sign up (no credit card) — API Keys — Create Key.
Google Gemini (Free tier): Go to aistudio.google.com — Get API key (may need billing attached).
OpenAI: Go to platform.openai.com — API Keys — Create new secret key.
Anthropic: Go to console.anthropic.com — API Keys — Create Key.
Kimi (Moonshot): Go to platform.moonshot.cn — API Keys — Create Key.
Which AI providers are supported?
Free (no credit card): Groq (Llama 3.3 70B, Qwen3 32B, GPT-OSS 120B), Cerebras (Llama 3.3 70B, Qwen3 32B), Google Gemini (2.5 Flash, 2.5 Flash Lite, 2.5 Pro). Paid: OpenAI (GPT-4o, GPT-4o Mini), Anthropic (Claude Sonnet 4, Claude 3 Haiku), Kimi (Moonshot 8K/32K/128K). Vision-capable providers (OpenAI, Anthropic, Gemini) also receive canvas screenshots.
How does the word-to-piece system work?
Every Tetris piece maps to a letter: I=International, O=Orange, T=Tiger, S=Snake, Z=Zebra, J=Jungle, L=Lemon. Type any English word starting with that letter and press Enter. The AI verifies your word and spawns the matching piece. You can type ANY word — it just needs to start with the right letter!
What is the word cooldown?
If you submit the same word twice in a row, a 1.5-second cooldown activates. The input locks and a red countdown ring appears. Wait for it to expire, then type a different word. This prevents spamming the same word repeatedly.
What is "Agentic Instruct"?
Custom instructions you give your AI agent. For example: "Be aggressive, always go for Tetrises (4-line clears)" or "Play safe, never leave gaps." These are combined with the built-in game manual (70+ lines covering board legend, piece shapes, scoring, and 8 strategy rules) that every AI agent receives.
How does the AI play Tetris?
Phase 1 — Word Choice: The AI receives a comprehensive game manual covering board layout, piece shapes, gravity, moves, scoring, and 8 strategy rules. It chooses a word whose first letter selects the best piece. Phase 2 — Move Execution: The AI reads the board state (and optionally a canvas screenshot for vision-capable providers) and decides each move until the piece locks. This two-phase loop repeats every turn.
What is the gravity speed setting?
Adjustable drop speed multiplier: 1x (normal), 2x, or 3x. Found in both the Settings screen and 2-Player Setup screen. Higher speeds make pieces fall faster. AI agents receive the current speed in their prompts.
What is the screenshot vision feature?
Vision-capable AI providers (OpenAI, Anthropic, Gemini) receive a canvas screenshot of the board in addition to the text representation. The AI assesses the visual state before choosing moves. Free providers (Groq, Cerebras, Kimi) use text-only prompts.
What are the game modes?
Play (1P): Single player, you type words to spawn pieces. 2-Player AI: Configure each player as Human or AI Agent. Supports Human vs Human, Human vs AI, AI vs AI (Agent vs Agent). Each player gets their own board and typing zone. If an AI agent has no API key configured, the game shows "No AI Agent" and blocks start.
What is the AI Harness?
A reliability system that keeps AI agents running smoothly. It retries failed API calls up to 3 times, enforces timeouts (15s for word choice, 10s for moves), validates that responses contain valid words and moves before execution, and provides graceful fallback (T-piece or soft drop) if the AI fails entirely.
Why does it say "No AI Agent"?
If you set a player to AI mode but haven't entered an API key, the game shows "No AI Agent" and won't start. Go to the 2-Player Setup screen and either configure an API key in the Settings or switch the player back to Human mode.
What is environment rotation?
A unique mechanic where the entire playfield rotates 90°, changing which side pieces spawn from and which direction gravity pulls. Rotating costs points and has a cooldown that shortens at higher levels. Use it strategically to clear hard-to-reach gaps!
Are my API keys safe?
API keys are stored locally in your browser's localStorage and are never sent to our servers directly. They are forwarded only to the AI provider's API through our local Express proxy. Use the "Erase Key" button in Settings to remove them anytime.
What is the Compatibility Check?
When you enter an API key, the game sends a test prompt to verify the key works and the model can return valid game moves. If the model responds correctly, it is marked "Compatible." This runs through our local proxy server — your key never leaves your machine unencrypted.
How does the post-game AI narrative work?
After a 2-player game, each AI agent receives the final score and win/lose status, then generates a 1-2 sentence speech (victory boast or defeat concession). These appear as narrative cards beside each player's board.
Is this a finished product?
This is a hackathon prototype. AI agents may hallucinate moves or enter mini-loops. Each AI agent plays one game per session (reset required for a new game). Free providers (Groq, Cerebras) have no credit card requirement but may have rate limits.

How This Works

Agentic AI Environment — Architecture Overview

👤
Player
Types a word
e.g. "tiger"
⌨️
Typing Zone
1st letter → Piece
T = tiger → T piece
cooldown if repeated
🔍
Verify Word
/api/verify-word
AI validates word
cache + fallback
🎮
Spawn Piece
10×20 grid
piece enters board
⬇️
Gravity
Pulls piece down
based on rotation
🕹️
Player Input
Arrows / Touch
move, rotate, drop
💥
Collision
Lock + line clear
onNeedPiece fires
Human → back to typing
AI Agent → choose word
🤖
Phase 1: Word Choice
Game manual + board
AI picks best word
☁️
AI Provider API
OpenAI / Anthropic
Gemini / Groq / Kimi
📸
Phase 2: Move Choice
Screenshot + board
AI picks one move
Execute Move
pushAIMove + execute
cycle repeats
🏆
Post-Game Narrative
AI generates victory / concession speech

Phase 1: Word Choice

When a piece locks, the engine fires onNeedPiece. For human players, the typing zone activates. For AI agents, a word choice prompt is built with the game manual, serialized board, score, level, gravity direction, and custom instructions. The AI responds with a word whose first letter selects the piece. The harness validates the response and retries if it fails.

Phase 2: Move Execution

Once the piece spawns, the AI receives a move prompt with the current board state and active piece. Vision-capable providers (OpenAI, Anthropic, Gemini) also receive a canvas screenshot for visual assessment. The AI responds with one move until the piece locks. The harness enforces a 10s timeout and validates each move before execution.

AI Harness

A reliability layer wrapping every AI call. Retry: up to 3 attempts with exponential backoff. Timeout: 15s for word choice, 10s for moves. Validation: checks responses for valid words and legal moves. Fallback: if AI fails, places a T-piece or does a soft drop. The harness rejects starts with "No AI Agent" when API keys are missing.

Gravity Speed

Adjustable drop speed at 1x, 2x, or 3x. Affects piece fall rate for all players. The engine calculates dropSpeed = max(2, round((35 - (level-1)*4) / gravitySpeed)). AI agents receive the current speed multiplier in their prompts.

AGENTIC TETRIS

A KD Vibe-A-Thon Project

CREATED BY

KrackedDevs

LEAD DEVELOPER

The Agentic Architect

AI ENGINE

Groq / Cerebras / Gemini

Llama 3.3 70B · Qwen3 · GPT-OSS

POWERED BY

OpenAI · Anthropic · Google

Moonshot · Groq · Cerebras

BUILT WITH

Vanilla JS · Canvas API

No frameworks. Pure chaos.

DESIGN

Playful Geometric

Animated blobs · Noise grain · Hard shadows

LEADERBOARD

FADLI KHALID

3,380 XP

kmal 4lif

2,160 XP

Muhammad Aqmar

1,800 XP

IVibe

1,650 XP

Masterofnone

1,340 XP

Muhaimin Juhari

1,135 XP

Bukan Nama

1,125 XP

danishsenju

940 XP

NUR AMIRAH

795 XP

syahiirah95

760 XP

Hafeez Pizofreude

745 XP

MoonWiRaja

745 XP

Ajwdxr

740 XP

Baihaqie Yusri

700 XP

Shanaqi

680 XP

Nel

600 XP

Aizzul Luqman

560 XP

Syarief Azman

500 XP

Kiyoraka

500 XP

Hazman Hassan

485 XP

KAGEROU

460 XP

Hanif Danial

430 XP

Salocin Dot TEN

350 XP

Irfan Ariff

340 XP

Jairon Landa

335 XP

Wan Morshidi

310 XP

Azman Hakim

290 XP

Syafiq Roslan

275 XP

Farid Rizal

260 XP

Dina Zulaikha

245 XP

Hafiz Zainal

230 XP

Amirul Hakim

210 XP

Rizqi Fahmi

195 XP

Cik Nurin

180 XP

Aiman Syahmi

160 XP

Firdaus Rosli

145 XP

Nadzmi Fikri

130 XP

Shazwan Rahim

110 XP

Haziq Nazri

90 XP

Izzat Danish

70 XP

Ammar Syazwan

45 XP

Adam Zarif

20 XP

KD Vibe A Thon

SOUND DESIGN

Web Audio API

Synthesized in real-time

SPECIAL THANKS

KD Vibe-A-Thon Judges

For believing in agentic chaos

kd-vibe-a-thon
𝕏 /KrackedDeevs
www.krackeddevs.com