Randomness

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

 Edit[ Stationary Robot ] -> [randomDir Robot]

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 ] -> [ ]

This is also a crafty way to request that a rule only be applied once. : )

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.