Dice button picks a random seed in the new-world dialog (t100)

This commit is contained in:
2026-10-29 22:14:40 -04:00
parent de6d2c1b33
commit 974e5a6272
9 changed files with 154 additions and 7 deletions
+6
View File
@@ -644,3 +644,9 @@ above, including:
requires fully explored space and prefers up on equal distances. A 256-point trail records
every four grains without per-tick allocations; loading rebuilds it from the bot position.
Searches happen only on burial, capped at 440 nudge and 256 trail probes per escape episode.
- **New-world seed controls (t100, 2026-10-29).** The owner asked for a dice icon beside
the seed and numeric validation matching the internal limit. Keep only digits and clamp
above 4294967295 with a nearby hint. Zero is a seed; empty means random on Generate.
The dice uses the same six-digit random rule as the initial field and refreshes the
automatic camp name while preserving a name the player typed.
+2 -1
View File
@@ -622,7 +622,7 @@ Shared world colours, minimap and full map.
Browser-only clocks; simulation code stays usable without a browser or a clock.
- variables: PERF_MARKS, PERF_FRAME, perfMarks, perfTimes, perfLast
### src/ui/loop.js (150 lines)
### src/ui/loop.js (170 lines)
The frame loop and boot.
- functions: scanVisible, frame, boot
- variables: lastT, acc, lastRender, frameMs, simMs, fpsSm, ambientT
@@ -678,6 +678,7 @@ The frame loop and boot.
- `test/t_render_dirty.js`: Render invalidation must not depend on whether a grain moved or the chunk stayed awake.
- `test/t_screw_heat.js`: t69: melt feedback, full-cost repair without disturbing the load, and repair undo.
- `test/t_screw_heat.py`: t69 only: both looks, persistent damage, hover, first message and real click/G repair.
- `test/t_seed.py`: t100: new-world seed editing, random button and generation, in both looks.
- `test/t_silo_contents.js`: Stored snow keeps its identity and remains in the world's water budget.
- `test/t_sim_optimizations.js`: Optimized paths must match the full roof scan and the original heat loop exactly.
- `test/t_slope_belt_art.js`: Drawing geometry against real parts, without changing transport.
+4
View File
@@ -94,6 +94,10 @@ screenshots go to `shots/t72-{retrace,escape,open}.png`.
## Browser tests
- `python3 test/t_seed.py` checks the new-world seed field: typed and pasted text,
real text dragging, clamping at 4294967295, zero and empty seeds, keyboard dice
activation, automatic/custom names and real generation with seed zero. Both-look
screenshots of the dice and limit hint go to `shots/t100-{pixel,smooth}.png`.
- They need the `.venv` from README.md → Develop; plain `python3` switches to it on its own.
- `test/play.py` (about 2.5 minutes) builds a world through the title screen and plays it with real
input. It checks the tools, building, copy/cut/paste, undo, the build menu, filters, pipes,
+12
View File
@@ -4,6 +4,18 @@ What agents have done, newest first. Add an entry for every piece of work: the d
note or request it was for, what changed, the files touched, the tests run, and anything left
open or not verified. Keep each entry short; the git history has the details.
## 2026-10-29: t100 new-world seed controls (Codex)
- Added a labeled dice button and shared seed parsing/random rule; ignore non-digits,
clamp above 4294967295 with a hint, preserve zero, and randomize empty on Generate.
- Files: src/shell.html, src/styles/style.css, src/ui/loop.js, test/t_seed.py,
test/run_all.py, docs/{DESIGN,TESTING,PROJECT_MAP}.md, tasks/t100* and this log.
- Ten seed checks failed against the unchanged build first. All 41 headless suites pass;
test/t_seed.py passes 21 checks (real clipboard/text drag and zero-world generation),
and pixel test/play.py shots/t100-play passes with no console errors. Browser runs
used host GPU access after sandbox WebGPU was unavailable. Inspected both-look
shots/t100-{pixel,smooth}.png and play/new-world.png. Map regenerated; nothing open.
## 2026-10-29: t87 reuse the near-miss view (Codex)
- Reused one scratch view, its entry array and get/has methods in src/sim/joins.js;