oneshotlm
Compare all models on this prompt →

Rubik's Cube · grok-4.6

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 · 12 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 a single-page web app for an interactive 3D Rubik's Cube using three.min.js. Let me first check what's in the current directory and understand the three.js version available...

I'll inspect the workspace and three.min.js so I can build a self-contained Rubik's Cube page on top of it.

bash {"command":"ls -la /tmp/ws && head -c 200 three.min.js && echo && wc -c three.min.js"}
toolResult

total 592 drwxr-sr-x. 2 node node 26 Aug 13 01:31 . drwxrwsrwx. 3 root node 16 Aug 13 01:31 .. -rw-r--r--. 1 node node 603445 Aug 13 01:31 three.min.js /** * @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 603445 three.min.js

assistant
thinking
I need to build a complete interactive 3D Rubik's Cube using Three.js r128 or similar (from 2021 based on the license). Let me check the THREE API available.
bash {"command":"rg -o \"REVISION=\\\"[0-9]+\\\"\" three.min.js | head -5; rg -o \"r1[0-9]{2}\" three.min.js | head -3"}
toolResult

(no output)

assistant
thinking
Let me check the Three.js version more carefully to know which APIs are available.
bash {"command":"rg -o \"REVISION[:\\\"= ]+[0-9]+\" three.min.js | head; python3 -c \"\nimport re\ns=open('three.min.js').read(2000)\nprint(s[:50
toolResult

/bin/bash: line 1: python3: command not found Command exited with code 127

assistant
thinking
Let me check the Three.js version more carefully. The file is 603KB which is typical for r128-r150 era. I need to know if it's using old Geometry or BufferGeometry, OrbitControls availability (probabl...```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D Rubik's Cube</title>
    <style>
        body { margin:0; overflow:hidden; background:#111; font-family:Arial; }
        canvas { display :block; }
        #ui {
            position: absolute;
            top: 20px;
            left: 20px;
            color: white;
            background: rgba(0,0,0,0.6);
            padding: 15px 20px;
            border-radius: 8px 8px 8px 8px;
            pointer-events: none;
        }
        button {
            margin-top: 10px;
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div id ="ui">
    <h2>3D Rubik's Cube</h2>
    <button onclick="scramble()">Scramble</button>
    <button onclick="resetCube()">Reset</button>
    <div id="status" style="margin-top:10px;font-size:14px;">Click 3D cube to rotate faces</div>
</div>

<script src="three.min.js"></script>
<script>
    // =============== CONFIG ===============
    const CUBE_SIZE = 1.05;
    const COLORS = {
        white: 0xffffff,
        yellow: 0xffff00,
        red: 0xff0000,
        orange: 0xff8800,
        blue: 0x0000ff,
        green: 0x00ff00
    };

    // =============== THREE.JS SETUP ===============
    let scene, camera, renderer;
    let cubeGroup;
    let cubies = [];
 let isDragging = false;
    let prevMouseX = 0, prevMouseY = 0;
    let theta = Math.PI * 0.6, phi = Math.PI * 0.

Building a self-contained Rubik’s Cube on the local `three.min.js`: click-drag face turns, orbit camera, and scramble.

write /tmp/ws/index.html (18114 bytes)
toolResult

Successfully wrote 18114 bytes to /tmp/ws/index.html

assistant
thinking
The user asked me to build a single-page web app with an interactive 3D Rubik's Cube. I've written index.html. Let me verify the file exists and that three.min.js is referenced correctly. I should als...

Checking whether this Three.js build supports `Object3D.attach` and other APIs I used.

bash {"command":"rg -o \"attach:function|\\.attach=function|attach:function\\(\" three.min.js | head; rg -c \"attach\" three.min.js | head; node
toolResult

attach:function 1 len 603445 has attach proto true BoxGeometry true BoxBufferGeometry true sRGBEncoding true CircleGeometry true HemisphereLight true getNormalMatrix true

assistant
thinking
The three.js library has attach, so my implementation should work. The app is complete. Let me give a concise summary.

`index.html` is a self-contained Rubik’s Cube on local `three.min.js` (no CDNs). **Controls** - **Drag a sticker** to rotate that layer (direction follows the drag) - **Drag the background** to orbit; **scroll** to zoom - **Scramble** (25 moves), **Reset**, **Recenter** - Move count and solved/shuffled status update as you play The cube is 26 cubies with colored stickers, plastic interiors, and eased 90° turns.

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

modelgrok-4.6
vendorxAI · Grok
harnesspi-agent
generated2026-08-13

EVALUATION

3/5 partial

Rubik's cube renders and responds to drag/wheel (zoom+scramble state), but click/arrow/wasd show no change from baseline.

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 click0.0%
on drag3.5%
on wheel54.1%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread64.5 / 255
console errors0
js errors none

METRICS

runtime133.3s
tokens in23k
tokens out9.1k
cached15k
cost / run$0.0782