Models 44

Gemini 3.1 Flash Lite

by GoogleReasoningClean
Open in new window

Running live in a sandboxed frame. Click inside it before using the keyboard.

How it went

Total time
4.3 s
Cost
$0.0022
Output tokens
1,430
Spent thinking
0 tokens
Speed
377.8 tok/s
Console errors
0
First token after
522 ms
First visible text after
522 ms
Prompt tokens
363
Code size
4.1 KB
Finish reason
stop
Served by
Google
Model id
google/gemini-3.1-flash-lite
Reasoning sent
{"effort":"none"}
Max output
65,536 tokens
Generated
Nov 12, 2026

What it was asked

The prompt
“i want a breakout game where the paddle is a hamburger and every brick you break explodes into tons of little hearts”
System prompt, sent with every prompt
You are generating a self-contained web demo. It will be rendered automatically in a sandboxed iframe and compared side by side with the output of other AI models given the exact same task.

Output rules:
- Reply with exactly ONE fenced code block containing the complete file: ```html (or ```svg when the task asks for an SVG). No text before or after the code block.
- Everything must be inline: CSS in <style>, JavaScript in <script>. No external files, images, fonts or network requests, except the CDN URLs explicitly allowed by the task.
- Do not use localStorage, sessionStorage, cookies, IndexedDB, alert(), confirm(), prompt() or window.open(): they are blocked in the sandbox and will throw.
- The page must look right in a 1280×800 viewport and adapt gracefully down to 375px wide. No horizontal scrollbar.
- Something meaningful must be visible on first paint: a screenshot is taken automatically about 3 seconds after load, without any interaction.
- Everything that makes the demo interesting must be visible within the first seconds: nothing hidden behind a high score, a later level or a long play session.
- Games must start in a self-playing demo mode (a simple AI plays) behind a "Click or press a key to start" message, so the game can be judged in action without playing.
- The iframe only receives keyboard events after the user clicks it: if the demo uses the keyboard, display a clear "Click or press a key to start" message.
- The code must run with zero errors in the console of the latest Chrome.

Code run-1.html · 122 lines

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Burger Breakout</title>
    <style>
        body { margin: 0; background: #222; display: flex; justify-content: center; align-items: center; height: 100vh; overflow: hidden; font-family: sans-serif; color: white; }
        canvas { border: 4px solid #f39c12; background: #1a1a1a; max-width: 95vw; max-height: 90vh; }
        #overlay { position: absolute; text-align: center; pointer-events: none; }
    </style>
</head>
<body>
    <div id="overlay">
        <h1>BURGER BREAKOUT</h1>
        <p>Click to Start / Use Mouse to move</p>
    </div>
    <canvas id="game"></canvas>

    <script>
        const canvas = document.getElementById('game');
        const ctx = canvas.getContext('2d');
        canvas.width = 800;
        canvas.height = 600;

        let gameStarted = false;
        const ball = { x: 400, y: 550, dx: 5, dy: -5, radius: 10 };
        const paddle = { w: 100, h: 40, x: 350, y: 560 };
        const bricks = [];
        const particles = [];

        for(let r=0; r<5; r++) {
            for(let c=0; c<8; c++) {
                bricks.push({ x: c * 95 + 25, y: r * 40 + 50, w: 80, h: 20, active: true });
            }
        }

        function drawBurger(x, y, w, h) {
            ctx.fillStyle = '#8B4513';
            ctx.fillRect(x, y + h/2, w, h/2); // Bottom bun
            ctx.fillStyle = '#FFD700';
            ctx.fillRect(x + 5, y + h/2 - 5, w - 10, 5); // Cheese
            ctx.fillStyle = '#FF4500';
            ctx.fillRect(x, y + 10, w, 10); // Patty
            ctx.fillStyle = '#DEB887';
            ctx.beginPath();
            ctx.ellipse(x + w/2, y + 10, w/2, 10, 0, 0, Math.PI * 2);
            ctx.fill(); // Top bun
        }

        function createHearts(x, y) {
            for(let i=0; i<15; i++) {
                particles.push({ x, y, vx: (Math.random()-0.5)*10, vy: (Math.random()-0.5)*10, life: 60 });
            }
        }

        function update() {
            if(!gameStarted) {
                ball.x = paddle.x + paddle.w/2;
            } else {
                ball.x += ball.dx;
                ball.y += ball.dy;

                if(ball.x < 0 || ball.x > canvas.width) ball.dx *= -1;
                if(ball.y < 0) ball.dy *= -1;

                if(ball.y > paddle.y && ball.x > paddle.x && ball.x < paddle.x + paddle.w) {
                    ball.dy = -Math.abs(ball.dy);
                }

                bricks.forEach(b => {
                    if(b.active && ball.x > b.x && ball.x < b.x + b.w && ball.y > b.y && ball.y < b.y + b.h) {
                        b.active = false;
                        ball.dy *= -1;
                        createHearts(b.x + b.w/2, b.y + b.h/2);
                    }
                });

                if(ball.y > canvas.height) { ball.x = 400; ball.y = 550; gameStarted = false; }
            }

            particles.forEach((p, i) => {
                p.x += p.vx; p.y += p.vy; p.life--;
                if(p.life <= 0) particles.splice(i, 1);
            });
        }

        function draw() {
            ctx.clearRect(0,0,800,600);
            drawBurger(paddle.x, paddle.y, paddle.w, paddle.h);
            
            ctx.fillStyle = 'white';
            ctx.beginPath(); ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI*2); ctx.fill();

            bricks.forEach(b => { if(b.active) { ctx.fillStyle = '#e74c3c'; ctx.fillRect(b.x, b.y, b.w, b.h); } });

            ctx.fillStyle = '#ff69b4';
            particles.forEach(p => {
                ctx.fillText('❤', p.x, p.y);
            });

            requestAnimationFrame(() => { update(); draw(); });
        }

        window.addEventListener('mousemove', e => {
            const rect = canvas.getBoundingClientRect();
            paddle.x = (e.clientX - rect.left) / (rect.width / 800) - paddle.w/2;
        });

        window.addEventListener('mousedown', () => gameStarted = true);
        window.addEventListener('keydown', () => gameStarted = true);

        // Simple AI demo mode
        setInterval(() => {
            if(!gameStarted) {
                paddle.x = ball.x - paddle.w/2;
            }
        }, 16);

        draw();
    </script>
</body>
</html>