From 9deccc1c82653ba7668ee32e08a260f5126742fc Mon Sep 17 00:00:00 2001 From: Nikhil Varma Date: Sat, 6 Jun 2020 16:52:19 +0530 Subject: [PATCH] fix: Fix simulation problem with neighbours --- src/components/SimulatorBoard/SimulatorBoard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/SimulatorBoard/SimulatorBoard.js b/src/components/SimulatorBoard/SimulatorBoard.js index 72501f2..47d3de2 100644 --- a/src/components/SimulatorBoard/SimulatorBoard.js +++ b/src/components/SimulatorBoard/SimulatorBoard.js @@ -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; @@ -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; @@ -91,7 +92,6 @@ class SimulatorBoard extends React.Component { } } } - console.log(nextFrame); this.setState({ grid: { rows: 30, cols: 30, gridTiles: nextFrame } }); };