Randomness

If you want a robot spawnpoint that generates randomly coloured robots, have this in your legend

Robot = RedRobot or GreenRobot or BlueRobot

and then use this in your script

 Edit[ RobotSpawn no robot ] -> [ RobotSpawn random Robot ]

You can only really use randomness once per cell - if you have several random statements they're all munged together. For instance, the above rule is identical to writing

[ RobotSpawn no Robot ] -> [ RobotSpawn random RedRobot random GreenRobot random BlueRobot]

If you want to have a rule applied a single time, at random (if possible) do this:

random [ Wall ] -> [ ]

In detail: what it does is - it works not on a single rule but on a rule group - it looks at all possible applications of all rules in that group, and picks one at random.

If you want a robot to move in a random direction each turn*, do this:

 Edit[ Stationary Robot ] -> [ randomDir Robot ]

* WARNING: random object movement is super unfun in most situations. Do not use this if you think it's going to be fun unless you're REALLY sure it's going to be fun. Predictable movement tends to work a lot better in puzzlescript games. See this demo for an example of deterministic entity movement (But even in this example it's not easy for the player to understand what happens when they try to walk into a spot and another character is trying to walk into the same spot. It's tricky to have independently-moving creatures, even without having randomness on top).