oneshotlm
Compare all models on this prompt →

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

Output generated Cost / run $0.0054 Runtime 74.6s

Prompt for this run

Build an interactive 3D 3 by 3 Rubik's Cube using the provided Three.js library. Use HTML, CSS, and JavaScript as needed. Write it to `index.html` in the current working directory using your file tools. Inline your own CSS and JavaScript. Do not use external assets, CDNs, or network requests. Use the provided `three.min.js` (global `THREE`) through a plain local script tag; the runner will inline it into the final artifact. Required behavior: - Start solved, with six distinct face colors and visible cubie boundaries. Preserve cubie and sticker state through moves; recoloring a static cube is not sufficient. - Provide visible buttons for U, D, L, R, F, B quarter turns and their inverses. Animate each move and queue or disable further moves until it completes so state is not corrupted. - Dragging the background orbits the camera without turning a face. Keep the cube fully visible initially and support bounded wheel zoom. - Provide Scramble, applying a sequence of legal turns, and Reset to restore the solved cube and initial camera. - Only core global THREE is provided; implement camera controls without importing unavailable addons. A solver is not required. Verify: Turn one face and apply its inverse, checking that the visible stickers return to their starting arrangement. Orbit the camera to inspect the cube from another angle, then use Reset and check the solved appearance and initial framing.

⛨ sandboxed Open in new tab ↗

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 0.87.1 · browser iteration
generated2026-10-14

METRICS

runtime74.6s
tokens in19k
tokens out6.4k
cached2.0k
cost / run$0.0054
Transcript · 11 messages
system

user

Build an interactive 3D 3 by 3 Rubik's Cube using the provided Three.js library. Use HTML, CSS, and JavaScript as needed. Write it to `index.html` in the current working directory using your file tools. Inline your own CSS and JavaScript. Do not use external assets, CDNs, or network requests. Use the provided `three.min.js` (global `THREE`) through a plain local script tag; the runner will inline it into the final artifact. Required behavior: - Start solved, with six distinct face colors and visible cubie boundaries. Preserve cubie and sticker state through moves; recoloring a static cube is not sufficient. - Provide visible buttons for U, D, L, R, F, B quarter turns and their inverses. Animate each move and queue or disable further moves until it completes so state is not corrupted. - Dragging the background orbits the camera without turning a face. Keep the cube fully visible initially and support bounded wheel zoom. - Provide Scramble, applying a sequence of legal turns, and Reset to restore the solved cube and initial camera. - Only core global THREE is provided; implement camera controls without importing unavailable addons. A solver is not required. Verify: Turn one face and apply its inverse, checking that the visible stickers return to their starting arrangement. Orbit the camera to inspect the cube from another angle, then use Reset and check the solved appearance and initial framing.

assistant
thinking
The user wants me to build an interactive 3D Rubik's Cube using Three.js. Let me break down the requirements:

1. 3x3 Rubik's Cube with 6 distinct face colors
2. Visible cubie boundaries
3. Buttons for U, D, L, R, F, B and their inverses (U', D', L', R', F', B')
4. Animated moves with queue/disabled input during animation
5. Camera orbiting via background drag (no external addons)
6. Zoom support
7. Scramble and Reset buttons
8. Only use three.min.js (local file)

Let me first check what's in the current directory and look at the three.min.js file.

I'll build this step by step. Let me first check the current directory and the Three.js library.

→ bash {"command":"ls -la /tmp/job-TvU3OA/"}
toolResult

total 604 drwx------ 3 node node 4096 Oct 14 02:35 . drwxrwxrwt 6 root root 4096 Oct 14 02:35 .. drwxr-xr-x 3 node node 4096 Oct 14 02:35 .home -rw-r--r-- 1 node node 603445 Oct 14 02:35 three.min.js

assistant
thinking
Good, I can see the three.min.js file. Now let me build the complete Rubik's Cube application. I need to:

1. Use Three.js from the local file
2. Create a 3x3 Rubik's cube with 27 cubies
3. Each cubie has 6 faces, but only the outer faces are colored
4. Implement face rotation with animation
5. Camera orbit controls (manual implementation since no addons)
6. Scramble and Reset functionality

Let me write the complete index.html file.
→ bash {"command":"head -c 500 /tmp/job-TvU3OA/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&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THREE={})}(this,(function(t){"use strict";const e="128",n=100,i=300,r=301,s=302,a=303,o=304,l=306,c=307,h=1e3,u=1001,d=1002,p=1003,m=1004,f=1005,g=1006,v=1007,y=1008,x=1009,_=1012,w=1014,b=1015,M=1016,S=1020,T=102

assistant
thinking
Good, it's a standard Three.js build. Let me create the full application now.

Now I'll build the complete Rubik's Cube application:

→ write /tmp/job-TvU3OA/index.html (17875 bytes)
toolResult

Successfully wrote to /tmp/job-TvU3OA/index.html

assistant
thinking
Good, the file has been written. Now let me open it in the browser and test it.

Now let me test it in the browser:

→ browser {"action":"screenshot"}
toolResult

Frame 1, +0ms

[Browser image supplied to model]

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","warning: [.WebGL-0x20540017b600]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x20540017b600]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x20540017b600]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0x20540017b600]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"Drag to orbit • Scroll to zoom • Click buttons to turn\nU\nU'\nD\nD'\nL\nL'\nR\nR'\nF\nF'\nB\nB'\n🔀 Scramble\n↺ Reset","images":"attached"}

assistant
thinking
The application is running and displaying a 3D Rubik's cube. I can see:
- The cube is visible with 6 face colors (white top, green front, red right side, etc.)
- The buttons are visible at the bottom
- The cube looks properly rendered with cubie boundaries visible

Let me now test the functionality:
1. Click U button and then U' to verify state persistence
2. Orbit the camera by dragging
3. Use Reset to verify solved state returns

Let me test by clicking some buttons.

The cube is rendering. Let me test the functionality by clicking some buttons: