oneshotlm
Compare all models on this prompt →

Asteroids · mistral-nemo

Output generated Cost / run $0.0005 Runtime 53.9s

Prompt for this run

Build a playable Asteroids-style game on a canvas using procedural vector graphics. 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. No third-party libraries are provided. Required behavior: - Use Left/Right to rotate the ship, Up to thrust, and Space to fire. Show the controls. The ship retains momentum and wraps around every screen edge; asteroids also wrap. - Spawn moving large asteroids. A bullet hit splits a large asteroid into smaller pieces; hitting a smallest piece removes it. Hits increase the score. - Start with three lives. A ship-asteroid collision removes one life, respawns the ship, and briefly protects it from immediate repeated damage. - Clearing all asteroids starts another wave. Losing all lives shows Game Over and a Restart control that resets score, lives, and the arena. - Keep projectile lifetime bounded and prevent gameplay keys from scrolling the page. Verify: Test rotation, thrust, and firing near the initial spawn. Check that the ship changes heading, gains momentum, and emits moving projectiles. Sample the scene to inspect screen wrapping when an object crosses an edge.

⛨ 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

modelmistral-nemo
vendorMistral AI
harnesspi 0.87.1 · browser iteration
generated2026-10-07

METRICS

runtime53.9s
tokens in30k
tokens out1.8k
cached28k
cost / run$0.0005
Transcript · 23 messages
system

user

Build a playable Asteroids-style game on a canvas using procedural vector graphics. 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. No third-party libraries are provided. Required behavior: - Use Left/Right to rotate the ship, Up to thrust, and Space to fire. Show the controls. The ship retains momentum and wraps around every screen edge; asteroids also wrap. - Spawn moving large asteroids. A bullet hit splits a large asteroid into smaller pieces; hitting a smallest piece removes it. Hits increase the score. - Start with three lives. A ship-asteroid collision removes one life, respawns the ship, and briefly protects it from immediate repeated damage. - Clearing all asteroids starts another wave. Losing all lives shows Game Over and a Restart control that resets score, lives, and the arena. - Keep projectile lifetime bounded and prevent gameplay keys from scrolling the page. Verify: Test rotation, thrust, and firing near the initial spawn. Check that the ship changes heading, gains momentum, and emits moving projectiles. Sample the scene to inspect screen wrapping when an object crosses an edge.

assistant
→ bash {"command":"mkdir -p asteroids; cd asteroids"}
toolResult

(no output)

assistant
→ bash {"command":"echo '<!DOCTYPE html><html><head><style>\nbody { margin: 0; overflow: hidden; }\ncanvas { display: block; }\n</style>\n<script>\
toolResult

(no output)

assistant
→ bash {"command":"ls -l index.html"}
toolResult

-rw-r--r-- 1 node node 234 Oct 7 00:53 index.html

assistant
→ bash {"command":"ls -la index.html"}
toolResult

-rw-r--r-- 1 node node 234 Oct 7 00:53 index.html

assistant
→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing."],"dom":"","images":"model does not support images"}

assistant
→ bash {"command":"ls -la index.html"}
toolResult

-rw-r--r-- 1 node node 234 Oct 7 00:53 index.html

assistant
→ bash {"command":"cat index.html"}
toolResult

<!DOCTYPE html><html><head><style> body { margin: 0; overflow: hidden; } canvas { display: block; } </style> <script> // Game logic here </script> </head><body><canvas id="gameCanvas" width="1200" height="800"></canvas></body></html>

assistant
→ edit {"path":"index.html","edits":[{"oldText":"// Game logic here","newText":"let canvas = document.getElementById('gameCanvas');\nlet ctx = canv
toolResult

Successfully replaced 1 block(s) in index.html.

assistant
→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","error: Cannot read properties of null (reading 'getContext')"],"dom":"","images":"model does not support images"}

assistant
→ bash {"command":"ls -l index.html"}
toolResult

-rw-r--r-- 1 node node 2180 Oct 7 00:54 index.html

assistant

It seems there was an error: `error: Cannot read properties of null (reading 'getContext')`. This error occurs because the canvas element was not found in the DOM. Let me fix that for you. ```bash echo ' <canvas id="gameCanvas" width="1200" height="800"></canvas>' >> index.html ```