ai21.net
言語

単一の自己完結型HTMLファイルを構築:3Dマーブルコンピューター…

単一の自己完結型HTMLファイルを構築:3Dマーブルコンピューター… — 1

プロンプト

Build a single self-contained HTML file: a 3D marble computer, in the spirit of Wintergatan's marble machine and the Digi-Comp II, that adds two 4-bit numbers using nothing but marbles falling through mechanical toggles.

Hard rules:

1. One HTML file. Three.js from https://t.co/KCQbEZLusb via an import map, plus its OrbitControls addon. No other libraries, no physics engine, no external assets.

2. The mechanism is the computer. Each bit of the result is stored in a two-state toggle (flip-flop) that a marble physically flips as it passes. Carries happen because a marble leaving one toggle rolls on to the next. Do not compute the answer in JavaScript arithmetic anywhere. The displayed result must be read from the toggle states after the last marble stops.

3. Marbles move along tracks with believable gravity and timing. Nothing teleports. You may script motion along paths, but every toggle flip must be caused by a marble arriving at it.

4. Input: two rows of four switches (A and B, 0 to 15), set by clicking. A lever labelled RUN releases the marbles. A counter shows how many marbles have fallen.

5. Output: a row of five result toggles, most significant bit on the left, and a readout that shows the binary and decimal value read from those toggles.

6. A DEMO button runs 5+6, then 9+7, then 15+15, resetting between runs, so it can be screen-recorded without touching anything.

7. Looks: a wooden board, brass toggles, glass marbles, warm studio lighting, soft shadows, a slow camera that follows the busiest part of the machine. It should look good in a square 1080x1080 recording.

8. Short click sounds via the Web Audio API when a toggle flips, started only after the first user click.

9. It must run at 60 fps on a normal laptop and have no console errors.

Output only the complete HTML file.

日本語訳

単一の自己完結型HTMLファイルを構築してください:WintergatanのマーブルマシンとDigi-Comp IIの精神に沿った3Dマーブルコンピューターで、機械式トグルを通って落ちるビー玉だけを使って2つの4ビット数を加算します。

厳格なルール:

1. HTMLファイルは1つ。https://t.co/KCQbEZLusb からインポートマップ経由でThree.jsを読み込み、そのOrbitControlsアドオンも加える。他のライブラリ、物理エンジン、外部アセットは一切使わない。

2. 機構そのものがコンピューターである。結果の各ビットは、ビー玉が通過する際に物理的に反転させる2状態トグル(フリップフロップ)に保存される。キャリーは、あるトグルを離れたビー玉が次のトグルへ転がり込むことで発生する。JavaScriptの算術で答えを計算してはいけない。表示される結果は、最後のビー玉が止まった後にトグルの状態から読み取らなければならない。

3. ビー玉はもっともらしい重力とタイミングでトラックに沿って動く。何もテレポートしない。パスに沿った動きをスクリプトで記述してもよいが、すべてのトグルの反転は、ビー玉がそこに到達したことによって引き起こされなければならない。

4. 入力:4つのスイッチの2列(AとB、0〜15)。クリックで設定する。RUNとラベルされたレバーがビー玉を解放する。カウンターは落下したビー玉の数を表示する。

5. 出力:5つの結果トグルの列。最上位ビットを左に置き、それらのトグルから読み取った2進数と10進数の値を表示する読み出し部。

6. DEMOボタンは5+6、次に9+7、次に15+15を実行し、実行の間にリセットするので、何にも触れずに画面録画できる。

7. 見た目:木の板、真鍮のトグル、ガラスのビー玉、暖かいスタジオ照明、柔らかな影、マシンで最も忙しく動く部分を追うゆっくりしたカメラ。正方形の1080x1080録画で美しく見えること。

8. トグルが反転するときにWeb Audio APIで短いクリック音を鳴らす。最初のユーザークリックの後にのみ開始する。

9. 普通のラップトップで60 fpsで動作し、コンソールエラーがないこと。

完全なHTMLファイルのみを出力してください。

出典

原作者
GodsBoy7777
公開日
2026-09-24(由推文 ID 反解)
原典
元の投稿を見る ↗
収録元
yihui-dev/awesome-opus5-5-videos · godsboy7777-150194 · MIT