Models 44

gpt-oss-120b

by OpenAIReasoning1 console error
Open in new window

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

How it went

Total time
40.1 s
Cost
$0.0005
Output tokens
2,777
Spent thinking
882 tokens
Speed
71.1 tok/s
Console errors
1
First token after
1.0 s
First visible text after
13.0 s
Prompt tokens
421
Code size
5.7 KB
Finish reason
stop
Served by
AkashML
Model id
openai/gpt-oss-120b
Reasoning sent
{"effort":"medium"}
Max output
64,000 tokens
Generated
Nov 11, 2026

Console errors

Caught in the first 3 seconds after load, in a sandboxed iframe like the one above.

Cannot access 'paddle' before initialization

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 · 215 lines

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Breakout Hamburger</title>
<style>
  html,body{margin:0;height:100%;background:#111;color:#eee;font-family:sans-serif;overflow:hidden}
  #game{display:flex;align-items:center;justify-content:center;height:100%}
  canvas{background:#222;border:2px solid #555;border-radius:8px}
  #overlay{
    position:absolute;top:0;left:0;right:0;bottom:0;
    background:rgba(0,0,0,0.7);
    color:#fff;display:flex;align-items:center;justify-content:center;
    font-size:2rem;cursor:pointer;z-index:5;
    text-align:center;padding:20px;
  }
</style>
</head>
<body>
<div id="game"><canvas id="c"></canvas></div>
<div id="overlay">Click or press any key to start</div>
<script>
(() => {
  const canvas = document.getElementById('c');
  const ctx = canvas.getContext('2d');
  const overlay = document.getElementById('overlay');

  // responsive canvas
  function resize() {
    const w = Math.min(800, innerWidth * 0.9);
    canvas.width = w;
    canvas.height = w * 0.6;
    initObjects();
  }
  window.addEventListener('resize', resize);
  resize();

  // game state
  let paddle, ball, bricks = [], hearts = [], rows = 4, cols = 9;
  let started = false, aiActive = false;

  function initObjects() {
    // paddle as hamburger
    paddle = { w: canvas.width * 0.2, h: 20, x: (canvas.width - canvas.width * 0.2) / 2, y: canvas.height - 30 };
    // ball
    ball = { r: 8, x: canvas.width / 2, y: canvas.height - 60, dx: 3, dy: -3 };
    // bricks
    const brickW = (canvas.width - 60) / cols - 10;
    const brickH = 20;
    bricks = [];
    for (let r = 0; r < rows; r++) {
      for (let c = 0; c < cols; c++) {
        bricks.push({
          x: 30 + c * (brickW + 10),
          y: 30 + r * (brickH + 10),
          w: brickW,
          h: brickH,
          hit: false,
          color: `hsl(${Math.random()*360},70%,60%)`
        });
      }
    }
    hearts = [];
  }

  // heart particle
  function spawnHearts(x, y, color) {
    const count = 30 + Math.random()*20;
    for (let i = 0; i < count; i++) {
      const angle = Math.random()*Math.PI*2;
      const speed = Math.random()*2+1;
      hearts.push({
        x, y,
        vx: Math.cos(angle)*speed,
        vy: Math.sin(angle)*speed,
        life: 60 + Math.random()*30,
        color
      });
    }
  }

  function drawHeart(px, py, size, col, alpha) {
    ctx.save();
    ctx.translate(px, py);
    ctx.scale(size, size);
    ctx.beginPath();
    ctx.moveTo(0, -0.4);
    ctx.bezierCurveTo(0.25, -0.7, 0.6, -0.5, 0.6, -0.15);
    ctx.bezierCurveTo(0.6, 0.2, 0.25, 0.5, 0, 0.7);
    ctx.bezierCurveTo(-0.25, 0.5, -0.6, 0.2, -0.6, -0.15);
    ctx.bezierCurveTo(-0.6, -0.5, -0.25, -0.7, 0, -0.4);
    ctx.closePath();
    ctx.fillStyle = col;
    ctx.globalAlpha = alpha;
    ctx.fill();
    ctx.restore();
  }

  function drawPaddle() {
    const {x, y, w, h} = paddle;
    // bun top
    ctx.fillStyle = '#c96';
    ctx.fillRect(x, y, w, h*0.4);
    // lettuce
    ctx.fillStyle = '#5c8';
    ctx.fillRect(x, y + h*0.4, w, h*0.2);
    // patty
    ctx.fillStyle = '#a52a2a';
    ctx.fillRect(x, y + h*0.6, w, h*0.4);
    // sesame seeds
    ctx.fillStyle = '#fff';
    for (let i = 0; i < 6; i++) {
      const sx = x + 5 + i*(w-10)/5;
      const sy = y + 4;
      ctx.beginPath();
      ctx.arc(sx, sy, 2, 0, Math.PI*2);
      ctx.fill();
    }
  }

  function update() {
    if (!started) return;
    // move ball
    ball.x += ball.dx;
    ball.y += ball.dy;

    // wall collisions
    if (ball.x+ball.r > canvas.width || ball.x-ball.r < 0) ball.dx *= -1;
    if (ball.y-ball.r < 0) ball.dy *= -1;
    // paddle collision
    if (ball.y+ball.r > paddle.y && ball.x > paddle.x && ball.x < paddle.x + paddle.w) {
      ball.dy = -Math.abs(ball.dy);
      // slight angle based on hit position
      const hitPos = (ball.x - (paddle.x + paddle.w/2)) / (paddle.w/2);
      ball.dx = hitPos * 4;
    }

    // brick collisions
    for (let b of bricks) {
      if (!b.hit &&
          ball.x > b.x && ball.x < b.x + b.w &&
          ball.y - ball.r < b.y + b.h && ball.y + ball.r > b.y) {
        b.hit = true;
        ball.dy *= -1;
        spawnHearts(b.x + b.w/2, b.y + b.h/2, b.color);
      }
    }

    // lose condition (reset)
    if (ball.y - ball.r > canvas.height) {
      initObjects();
      started = false;
      overlay.style.display = 'flex';
      overlay.textContent = 'Click or press any key to start';
      return;
    }

    // AI paddle movement
    if (aiActive) {
      paddle.x += (ball.x - paddle.x - paddle.w/2) * 0.09;
      if (paddle.x < 0) paddle.x = 0;
      if (paddle.x + paddle.w > canvas.width) paddle.x = canvas.width - paddle.w;
    }

    // update hearts
    for (let i = hearts.length-1; i>=0; i--) {
      const p = hearts[i];
      p.x += p.vx;
      p.y += p.vy;
      p.vy += 0.05; // gravity
      p.life--;
      if (p.life <= 0) hearts.splice(i,1);
    }
  }

  function draw() {
    ctx.clearRect(0,0,canvas.width,canvas.height);
    // draw bricks
    for (let b of bricks) if (!b.hit) {
      ctx.fillStyle = b.color;
      ctx.fillRect(b.x, b.y, b.w, b.h);
    }
    // draw hearts
    for (let p of hearts) {
      drawHeart(p.x, p.y, 0.8, p.color, p.life/80);
    }
    // draw paddle
    drawPaddle();
    // draw ball
    ctx.fillStyle = '#fff';
    ctx.beginPath();
    ctx.arc(ball.x, ball.y, ball.r, 0, Math.PI*2);
    ctx.fill();
  }

  function loop() {
    update();
    draw();
    requestAnimationFrame(loop);
  }
  requestAnimationFrame(loop);

  // start control
  function startGame() {
    if (started) return;
    started = true;
    aiActive = true;
    overlay.style.display = 'none';
  }
  overlay.addEventListener('click', startGame);
  window.addEventListener('keydown', startGame);
})();
</script>
</body>
</html>
Reasoning trace (882 tokens)
The user wants a breakout game where paddle is a hamburger (so paddle image or shape like a hamburger) and bricks explode into tons of little hearts when broken. Must be self-contained HTML (inline CSS/JS). Must be visible on first paint. Provide demo mode with auto-play (simple AI) after a "Click or press a key to start" message. The game should start automatically playing after user interaction, but even before that, we need visible content for screenshot. So show title, maybe initial start screen with message and a static version of paddle and bricks? Probably show the message with a screenshot that's acceptable.

Implement a simple breakout: canvas-based. Paddle drawn as hamburger shape (maybe using rectangles and lines to represent bun and patty). Bricks as simple rectangular blocks, each with color. When hit, the brick disappears and triggers explosion of many heart particles (draw small heart shapes using path). Use requestAnimationFrame loop.

Implement AI: once started, a simple AI moves paddle to follow ball's x coordinate with some delay.

Add start overlay that says "Click or press any key to start". On click/keydown, hide overlay and start AI.

Visible on first paint: show overlay and maybe a static depiction? The screenshot will capture the overlay with message, that's okay.

Implement responsive canvas: width 100% max maybe 800px, height keep aspect ratio. Use CSS to center.

All code must be within a single HTML block.

Make sure no external images; we can draw hamburger paddle using canvas drawing (brown bun, green lettuce, etc) or we could use CSS styled element for paddle (but we use canvas anyway). Simpler: draw the paddle (rectangle) with a pattern or draw details: two buns and a patty.

Hearts: draw small hearts using path.

Implement explosion: spawn many heart particles at brick location with random velocities, fade out.

Implement ball movement, collisions.

Implement scoring display maybe.

All within 1280x800.

Make sure no errors.

Let's code.

Implementation steps:

- HTML: canvas element, overlay div with start message.

- CSS: style canvas (border maybe), overlay (centered absolute, dark transparent background).

- JS: define constants: canvas, ctx, dimensions based on window inner width but limited.

- Game objects: ball (x,y,r,dx,dy), paddle (x,width,height), bricks (grid with rows, cols, status). brick width maybe 60, height 20, padding 5, offset top 30, left 30.

- On each frame: move ball, bounce off walls, paddle, bricks.

- On brick hit: set status 0, spawn hearts: array of particles with position, velocity, life (alpha). Add to hearts array.

- Render: clear, draw bricks (if status), draw paddle as hamburger (custom drawing), draw ball, draw hearts (small hearts with fade).

- Paddle drawing: Use ctx.fillStyle for buns, sesame seeds etc. Could draw two semi-circles top and bottom and a rectangle middle representing patty.

Simplify: draw top bun as arc, bottom bun as arc, middle rectangle with patty color.

function drawPaddle() { let x= paddle.x; let y= canvas.height - paddle.height - 10; let w=paddle.width; let h=paddle.height; // but we will treat height ~20.

We'll draw: top bun: ctx.beginPath(); ctx.arc(x + w/2, y + h/3, w/2, Math.PI, 0, false ); fill brown ; bottom bun: arc with same center later but inverted? Actually easier: draw rectangle for bun height, then overlay lines for seeds.

Simplify: draw rectangle as brown for top bun, then green lettuce: small rectangle, then darker brown patty.

Acceptable.

- AI: after start, each frame set paddle.x = ball.x - paddle.width/2 with constraints.

- Input: on click or keydown: hide overlay, set started true.

- In overlay show message: "Click or press any key to start". Ensure visible.

- Responsive: set canvas width = Math.min(800, window.innerWidth*0.9); height = canvas.width * 0.6; Then on resize recalc maybe.

- No external assets.

Ok finalize.