# PrimaSTEM Simulator: guide for AI assistants Also available as https://simulator.primastem.com/ai (HTML page) and https://simulator.primastem.com/ai.txt (plain text). ## 1. What this is https://simulator.primastem.com is a browser copy of the PrimaSTEM control board and its drawing robot (a ladybug with a marker). A program is a set of tiles placed into the board's cells; the robot executes them on a square field and draws its path. The whole scene (program, settings, robot start pose, optional maze) fits into a share link, and `&run` makes the program start by itself after the page opens. The page is a JavaScript app, so you cannot "use" it by reading it; you build the link from the rules below. ### How to answer a user 1. Translate the task into board tiles (sections 3 and 4). 2. Pick a robot start pose that keeps the whole figure on the field (section 5). 3. Give the user one complete link that ends with `&run`. It opens the simulator, loads the program and starts it about 4 seconds later. 4. In plain words, say what the program does and where the tiles sit ("top row: Function x10; function row: Forward 100, Right 36"), so the user can rebuild it on a real board. The user can press the round Start button to run it again. Copy the structure of a worked example (section 6) and change only what you need. Every example link there was opened and checked in a browser. ### Before you answer: self-check (mandatory) - [ ] **Rows.** `top=` lists at most 6 pairs, `fn=` at most 5, separated by commas. Each pair is `command` or `command.value` (one dot, no spaces). Use `top=`/`fn=`, not the old `p=`. - [ ] **Pairs.** One command plus at most one value; no number next to `cfun` or `crnd`; a number and a repeat never share a pair. - [ ] **Trace.** Go through the program step by step and write down the (x, y) of every corner. Every point must stay within 60 ... (N*150 - 60) mm, i.e. 60 ... 840 on the default 6x6 field. - [ ] **Same pose.** The `&r=x-y-h` in the link is exactly the start pose you described and traced. - [ ] **Codes.** Every value is a 4-character code: `n`/`r`/`a`/`s`/`m`/`d`/`e` plus 3 digits (`n045`, `r007`), or `sqrt`/`rrnd`. ## 2. Link grammar ``` https://simulator.primastem.com/#top=&fn=&s=<8 chars>&r=--[&m=][&sh=][&lang=]&run ``` Everything after `#` is a fragment; parameters may come in any order. No URL-encoding is needed: all characters are `a-z 0-9 . , - & = #`. | Param | Value | Meaning | |---|---|---| | `top` | up to 6 pairs, separated by `,` | The top row (the main program), pairs 1-6 from the left. | | `fn` | up to 5 pairs, separated by `,` | The function row (a subroutine), pairs 1-5. Leave `fn` out when the program has no Function tile. | | `s` | 8 characters, read by position | View settings (table below). If omitted: light theme, marker on, grid ON, speed x1, field 6x6, flat view. | | `r` | `x-y-heading` | Robot start: centre in mm and heading in degrees. Use integers, heading 0-359. **Always include it**: without `r` the robot starts in a random cell. | | `m` | digit pairs `cr` | Optional maze (section 6.8). Turns the grid and maze mode on. | | `sh` | `square triangle star house circle spiral` | Optional "Repeat the shape" task: turns the grid off and challenge on, shows that target contour and puts the robot on its start (the task sets the start, so `r` is ignored). A run that draws the contour within 15 mm gets the win card. A maze (`m`) wins if both are given. | | `lang` | `en fr es it nl de sv nb pl ru uk da ca pt fi tr ja he ar` | Optional UI language. Without it the page follows the visitor's saved choice or browser language. | | `run` | `&run` or `&run=N` | Start the program automatically, N seconds (default 1, at most 3600) after the 3-second splash. Needs at least one non-empty pair in the top row. | | `embed` | `&embed=play` or `&embed=full` | Only for a link placed in an `