Skip to content

Question about array scope in Game of Life #8

@daveronson

Description

@daveronson

Great video about creating the Game of Life.

I was trying to enhance the gridSize function to call this.seed and then this.playButton after this.clear but I get an out of bounds error when choosing the largest grid because the array is still 50x30 and it's trying to seed 70x50. This obviously doesn't happen in the original code when you select gridSize and then separately click the seed button.

I'm not sure if this is state vs prop vars, an array creation issue or if this is a array scope issue? Any thoughts would be appreciated.

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