Browse Source

cleaned up the files a little

Brandon Wong 8 years ago
parent
commit
d7dca724c8
6 changed files with 4 additions and 32 deletions
  1. 2 2
      index.html
  2. 1 3
      package.json
  3. 1 1
      src/main.js
  4. 0 26
      src/rules.js
  5. BIN
      styles/earthtones.jpg
  6. 0 0
      styles/life.css

+ 2 - 2
index.html

@@ -3,10 +3,10 @@
 <head>
     <meta charset="UTF-8">
     <title>Conway's Game of Life</title>
-    <link rel="stylesheet" href="life.css">
+    <link rel="stylesheet" href="styles/life.css">
 </head>
 <body>
-    <div id="board"></div>
+    <div id="jar"></div>
     <script src="build/bundle.js"></script>
 </body>
 </html>

+ 1 - 3
package.json

@@ -8,9 +8,7 @@
     "compile-src": "babel src --out-dir build",
     "compile-frontend": "webpack src/main.js build/bundle.js --module-bind 'js=babel-loader'",
     "compile": "npm run compile-src; npm run compile-test; npm run compile-frontend",
-    "watch": "nodemon --watch src --watch test --exec \"npm run compile --silent\"",
-    "serverwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && node build/server.js\"",
-    "testwatch": "nodemon --watch src --watch test --exec \"npm run compile --silent && npm test\""
+    "watch": "nodemon --watch src --watch test --watch styles -e js,css,html --exec \"npm run compile --silent\""
   },
   "private": true,
   "dependencies": {

+ 1 - 1
src/main.js

@@ -98,7 +98,7 @@ let world = populateRandomly(generateWorld(100, 20));
 
 ReactDOM.render(
     <Board settings={settings} world={world} />,
-    document.getElementById('board')
+    document.getElementById('jar')
 );
 
 

+ 0 - 26
src/rules.js

@@ -1,26 +0,0 @@
-
-
-export default function processCell(neighbourhood) {
-    const livingNeighbours = neighbourhood.reduce(function countRows(acc, row, ind) {
-        return acc + row.reduce((s, c, i) => (!(ind === 1 && i === 1) ? s+c : s));
-    }, 0);
-
-    if( neighbourhood[1][1] ) {
-        if( livingNeighbours < 2 ) {
-            neighbourhood[1][1] = 0;
-        }
-        else if( livingNeighbours > 3 ) {
-            neighbourhood[1][1] = 0;
-        }
-    }
-    else {
-        if( livingNeighbours === 3 ) {
-            neighbourhood[1][1] = 1;
-        }
-    }
-
-    return neighbourhood;
-}
-
-
-

BIN
styles/earthtones.jpg


life.css → styles/life.css