Skip to content

Randomise the initial 2D state of the grid #2

@georgikoemdzhiev

Description

@georgikoemdzhiev

Currently, the initial "Alive" cells are hard-coded in Main.cs

    private void RandomiseGrid()
    {
        // TODO implement good random algorithm
        _grid.CellGrid[2, 5].IsAlive = true;
        _grid.CellGrid[2, 6].IsAlive = true;
        _grid.CellGrid[2, 7].IsAlive = true;
        _grid.CellGrid[3, 6].IsAlive = true;
        _grid.CellGrid[3, 7].IsAlive = true;
        _grid.CellGrid[3, 8].IsAlive = true;
        _grid.CellGrid[3, 9].IsAlive = true;
        _grid.CellGrid[3, 1].IsAlive = true;
        _grid.CellGrid[3, 2].IsAlive = true;
        _grid.CellGrid[3, 3].IsAlive = true;
    }

We can use an algoritghm to randomise the grid instead.

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