NetLogo Help: hatch

### hatch1.0

#### hatch number [ commands ] hatch-<breeds> number [ commands ]

This turtle creates number new turtles. Each new turtle inherits of all its variables, including its location, from its parent. (Exceptions: each new turtle will have a new `who` number, and it may be of a different breed than its parent if the `hatch-<breeds>` form is used.)

The new turtles then run commands. You can use the commands to give the new turtles different colors, headings, locations, or whatever. (The new turtles are created all at once, then run one at a time, in random order.)

If the hatch-<breeds> form is used, the new turtles are created as members of the given breed. Otherwise, the new turtles are the same breed as their parent.

    hatch 1 [ lt 45 fd 1 ]
    ;; this turtle creates one new turtle,
    ;; and the child turns and moves away
    hatch-sheep 1 [ set color black ]
    ;; this turtle creates a new turtle
    ;; of the sheep breed

See also create-turtles, sprout.

Take me to the full NetLogo Dictionary