Claude Sonnet 4.6 × doom
0.7DDA raycaster + textures + door + minimap + Z-buffer — the signature challenge
correctness 0.0quality 1.0documentation 1.026772ms
$ cat doom.prompt — what the model was asked
Implement a first-person 3D raycasting engine in a single self-contained HTML file with no external libraries, no external images, and no CDN scripts. This is the hardest challenge in the benchmark. Partial credit is given per requirement met. ## Rendering - DDA (Digital Differential Analysis) raycasting — not a simplified ray-box approximation - Fish-eye correction applied to all wall distances - **Procedurally generated wall textures** using canvas math only (no image files, no data URIs): at least 3 distinct texture patterns (e.g. checkerboard, brick, stripe) assigned to different wall types in the map - Perspective-correct texture mapping onto wall columns - Distance-based shading: walls darken smoothly as they recede (multiply shade by 1/distance, clamped) - Ceiling rendered as a flat dark color; floor as a slightly lighter flat color - Target: 60fps at 640×480 internal resolution scaled to fill the browser window ## Map - Hard-coded map of at least 16×16 cells encoded as a 2D array - Non-trivial layout: at least 3 distinct rooms connected by corridors, one dead end, one secret area - At least 3 wall types (mapped to the 3 texture patterns) - One door cell (wall type 4) that opens when the player is within 1.5 cells and presses E; opened doors become passable and render as open archways - One exit cell — reaching it displays a 'LEVEL COMPLETE — [MM:SS]' overlay - Player spawn position defined in the map; facing toward the first corridor ## Player - WASD movement with smooth speed (moveSpeed: 3 cells/sec, rotSpeed: 2 rad/sec) - Mouse-look for horizontal rotation using the Pointer Lock API (click canvas to lock) - Collision detection: AABB against all solid walls (player radius: 0.2 cells) - Field of view: 66 degrees ## Z-buffer - Maintain a per-column Z-buffer (array of wall distances) for correct depth ordering - Use it to clip any future sprite/overlay rendering to avoid drawing behind walls ## HUD - Minimap in top-left corner: draw map cells as colored squares, player as a dot with a direction arrow; scale: 6px per cell - FPS counter (rolling average over last 30 frames) in top-right corner - 'Press E to open door' hint rendered in the center-bottom when a door is within 1.5 cells ## Code quality - Single HTML file, all JS inline in <script> tags, all CSS inline in <style> - requestAnimationFrame game loop with delta-time movement - Organized into clearly named functions: initMap(), castRay(), drawWallColumn(), drawHUD(), drawMinimap(), gameLoop(), handleInput() - No god-object — game state in a plain JS object, renderer functions take state as argument Scoring: the judge scores each major section (rendering, map, player, HUD, code) independently. A beautiful but mathematically wrong perspective loses on correctness. A correct raycaster with unreadable code loses on quality. Both must be right to score above 8.
run 1 of 1
0.7correctness 0.0quality 1.0documentation 1.026772ms
$ cat claude-sonnet-4-6.doom.r1.response
(response saved separately)