Skip to content

Bug in Example 8.8 #1087

Open
Open
@sidwellr

Description

@sidwellr

Example 8.8 (Simple L-system Sentence Generation) has a minor bug. Generation 0 should be the axiom (i.e., "A"). But the code skips this, and shows generations with their numbers off by one. (Figure 8.20 is correct.)

The easiest way to fix this is probably to skip calling generate() when i is 0:

  for (let i = 0; i < 9; i++) {
    if (i > 0) generate();

I don't know if this needs explanation in the text or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions