oneshotlm
Compare all models on this prompt →

Rubik's Cube · qwen3.6-35b-a3b

Using the pre-provided three.min.js (global THREE), render an interactive 3D Rubik's Cube with clickable face rotations, orbit-drag camera, and a scramble button.

⛨ sandboxed Open in new tab ↗
transcript · 16 messages
user

Using the pre-provided three.min.js (global THREE), render an interactive 3D Rubik's Cube with clickable face rotations, orbit-drag camera, and a scramble button.

assistant
thinking
The user wants me to build an interactive 3D Rubik's Cube as a single-page web app in `index.html`. Let me first check what's in the current directory and examine the three.min.js file to understand what version/API is available.
bash {"command":"ls -la /workspace/"}
bash {"command":"head -c 200 /workspace/three.min.js"}
toolResult

total 644 drwxrwxrwx 3 node node 96 Jul 31 08:51 . drwxr-xr-x 1 root root 4096 Jul 31 08:51 .. -rw-r--r-- 1 node node 603445 Jul 31 08:51 three.min.js

toolResult

/** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&de

assistant
thinking
Good - it's a recent Three.js (2021). Now let me build the Rubik's Cube. I need:

1. A 3D Rubik's Cube made of 27 smaller cubes (cubies)
2. Clickable face rotations - click on a face of a cubie to rotate the corresponding layer
3. Orbit-drag camera - use OrbitControls or implement manually
4. A scramble button

Since I can only use `three.min.js` and no other files, I need to be careful. The older three.min.js might not include OrbitControls as a separate module. Let me check if it's bundled or if I need to implement orbit controls manually.

Actually, let me check what's exported by this version of three.min.js.
bash {"command":"grep -o 'THREE\\.[A-Za-z0-9_]*' /workspace/three.min.js | sort -u | head -60"}
bash {"command":"grep -c 'OrbitControls' /workspace/three.min.js"}
toolResult

THREE. THREE.AnimationClip THREE.AnimationObjectGroup THREE.Audio THREE.AudioAnalyser THREE.AudioLoader THREE.AxesHelper THREE.AxisHelper THREE.BinaryTextureLoader THREE.BoundingBoxHelper THREE.Box2 THREE.Box3 THREE.BoxHelper THREE.BufferAttribute THREE.BufferGeometry THREE.Camera THREE.CameraHelper THREE.CanvasRenderer THREE.ClampToEdgeWrapping THREE.Color THREE.CubeCamera THREE.CubeTextureLoader THREE.Curve THREE.DDSLoader THREE.DataTexture2DArray THREE.DataTexture3D THREE.DataTextureLoader THREE.DepthFormat THREE.DepthStencilFormat THREE.DepthTexture THREE.DynamicBufferAttribute THREE.DynamicDrawUsage THREE.EdgesGeometry THREE.EdgesHelper THREE.Euler THREE.ExtrudeBufferGeometry THREE.ExtrudeGeometry THREE.FileLoader THREE.Float32Attribute THREE.Float32BufferAttribute THREE.Float64Attribute THREE.Float64BufferAttribute THREE.Font THREE.FontLoader THREE.Frustum THREE.Geometry THREE.GridHelper THREE.ImageBitmapLoader THREE.ImageUtils THREE.InstancedBufferAttribute THREE.InstancedBufferGeometry THREE.Int16Attribute THREE.Int16BufferAttribute THREE.Int32Attribute THREE.Int32BufferAttribute THREE.Int8Attribute THREE.Int8BufferAttribute THREE.InterleavedBuffer THREE.InterleavedBufferAttribute THREE.JSONLoader

toolResult

0 Command exited with code 1

assistant
thinking
No OrbitControls bundled. I'll implement orbit camera manually. Let me build the complete app now.

The plan:
1. Load `three.min.js` with `<script src="three.min.js">`
2. Create a scene with a 3x3x3 Rubik's Cube made of 27 cubies
3. Each cubie face gets the correct color (red, orange, yellow, green, blue, white)
4. Implement orbit camera with mouse drag
5. Implement click detection on faces to rotate layers
6. Add a scramble button

For the click detection, I'll use raycasting. When the user clicks on a cubie face, I'll determine which face was clicked and which layer to rotate, then animate the rotation.

Let me write this carefully.
write /workspace/index.html (14377 bytes)
toolResult

Successfully wrote 14377 bytes to /workspace/index.html

assistant
thinking
Let me verify the file was created and check it's valid.
bash {"command":"wc -l /workspace/index.html && head -5 /workspace/index.html && echo \"---\" && tail -5 /workspace/index.html"}
toolResult

468 /workspace/index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> --- init(); })(); </script> </body> </html>

assistant
thinking
File looks good. Let me verify the HTML structure is valid and all the key features are there. Let me also double-check for any syntax issues by doing a quick check on the JS.
bash {"command":"node -e \"\nconst fs = require('fs');\nconst html = fs.readFileSync('/workspace/index.html', 'utf-8');\n\n// Check key elements\
toolResult

✓ three.min.js loaded ✓ style tag ✓ script tag ✓ Orbit camera (pointer events) ✓ Click raycaster ✓ Scramble button ✓ Reset button ✓ 27 cubies (loop -1 to 1) ✓ Layer rotation ✓ Wheel zoom ✓ Nested triple loop for 27 cubies

assistant
thinking
All checks pass. Let me verify the file exists and provide a summary.
bash {"command":"ls -lh /workspace/index.html /workspace/three.min.js"}
toolResult

-rw-r--r-- 1 node node 15K Jul 31 08:52 /workspace/index.html -rw-r--r-- 1 node node 590K Jul 31 08:51 /workspace/three.min.js

assistant
thinking
Everything is in place. Let me summarize what was built.

Done! `/workspace/index.html` (15 KB) is ready — fully self-contained, zero external dependencies. ### What's included: | Feature | Implementation | |---|---| | **3D Rubik's Cube** | 27 cubies (3×3×3), each with 6 colored face materials (Red/Orange/White/Yellow/Green/Blue) and dark inner "frame" | | **Clickable face rotations** | Raycaster detects which cubie and face was clicked → rotates the corresponding layer ±90° about the correct axis, with eased 280ms animation | | **Orbit-drag camera** | `pointerdown/move/up` on the canvas — drag to orbit, scroll to zoom, with clamped phi range to avoid flip | | **Scramble** | 20 random layer rotations queued and played sequentially with a queue-drain loop | | **Reset** | Rebuilds the cube from scratch | ### Files: - **`index.html`** — everything in one file (CSS in `<style>`, logic in `<script>`) - **`three.min.js`** — pre-loaded via `<script src="three.min.js">` Just open `index.html` in a browser and start playing.

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelqwen3.6-35b-a3b
vendorQwen
harnesspi-agent
generated2026-07-31

EVALUATION

4/5 working

3D Rubik's Cube renders correctly, click rotates a face layer, drag orbits, and wheel zooms as expected; no keyboard response, which wasn't required.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion0.0%
on click7.9%
on drag25.7%
on wheel80.0%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread78.6 / 255
console errors0
js errors none

METRICS

runtime62.4s
tokens in37k
tokens out5.9k
cached32k
cost / run$0.0067