-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaoc17.js
41 lines (32 loc) · 794 Bytes
/
aoc17.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const {inRange} = require("lodash");
const log = (arg) => console.log(arg) && arg;
require('fs').readFile('./aoc17.txt', 'utf8', (_, content) => {
const initialSlice = content
.split('\n')
.slice(0, -1) // strip ending line
.map(x => [...x]);
main(data);
main2(data);
});
function getNeighbours() {
}
function isActive(cube) {
return false;
}
function getNewState() {
const neighbours = getNeighbours();
const activeNeighbours = neighbours.filter(isActive);
if(isActive(cube)) {
if(inRange(activeNeighbours.length, 2, 4)) {
return '#';
}
} else {
if(activeNeighbours.length === 3) {
return '#';
}
}
return '.';
}
function main(data) {
}
function main2(data) {}