Skip to content

Possible small code errors in listings 5 and 11? #12

Open
@masonhieb

Description

@masonhieb

On this line here in listing 11, shouldn't tree.y = depth be at the top of the setup function?

I was implementing this recently and, with the function written as shown, I believe that code would only set the y values for trees with no children, but it should be setting the y values for every tree, should it not? Or is there an assumption here that the y-values are already set elsewhere (since most of the real complexity comes from the x coordinates, not the y coordinates)?

Additionally, in listing 5 this tree.offset class variable is used but seems to be accidentally copied over from listing 4. Should that value instead be tree.mod?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions