Chapter 13 - Generating the World
To generate the world:
randomly place the terrain features;
repeat with bot running through robots:
deploy bot;
now the x-displacement of bot is (the slowness of bot + 1) / 2;
now the y-displacement of bot is (the slowness of bot + 1) / 2;
repeat with Cosmo running through astronauts:
deploy Cosmo;
repeat with blazon running through beacons:
deploy blazon;
deploy the spaceship exterior;
deploy the wreckage of the Russ;
update the coordinates of carried items.
To deploy (item - the spaceship exterior):
now the spaceship exterior is in the Planet;
now the x-coordinate of the spaceship exterior is 1;
now the y-coordinate of the spaceship exterior is grid size / 2;
[dump the planet map.]
To deploy (item - a thing):
now item is in Planet;
now the x-coordinate of item is a random number between 1 and the grid size;
now the y-coordinate of item is a random number between 1 and the grid size.
To deploy (item - a beacon):
now the owner of the item carries the item.
To deploy (item - wreckage of the Russ):
now item is in Planet;
now the x-coordinate of item is grid size / 2;
now the y-coordinate of item is grid size / 2.