Skip to content

Commit

Permalink
fix: Fix simulation problem with neighbours
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil-varma committed Jun 6, 2020
1 parent 78ec713 commit 9deccc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/SimulatorBoard/SimulatorBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class SimulatorBoard extends React.Component {
[1, 0],
[1, 1],
[-1, -1],
[-1, 0],
[0, -1],
];
for (let d = 0; d < neighborDirections.length; d++) {
let newX = neighborDirections[d][0] + x;
Expand All @@ -71,7 +73,6 @@ class SimulatorBoard extends React.Component {
};

runSimulation = () => {
console.log("running");
let nextFrame = this.spawnTiles(this.noSpawnCallback, false);
const { grid } = this.state;
const { rows, cols, gridTiles } = grid;
Expand All @@ -91,7 +92,6 @@ class SimulatorBoard extends React.Component {
}
}
}
console.log(nextFrame);
this.setState({ grid: { rows: 30, cols: 30, gridTiles: nextFrame } });
};

Expand Down

0 comments on commit 9deccc1

Please sign in to comment.