Skip to content

Commit 9add73b

Browse files
committed
Added day 18 part 2
1 parent ec6d11a commit 9add73b

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
// project meta data
66
group 'de.havox_design.aoc2015'
7-
version '0.17.2'
7+
version '0.17.3'
88

99
// Switch to gradle "all" distribution.
1010
wrapper {

day18/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,62 @@ After 4 steps:
7575
After 4 steps, this example has four lights on.
7676

7777
In your grid of 100x100 lights, given your initial configuration, **how many lights are on after 100 steps**?
78+
79+
# Part Two
80+
You flip the instructions over; Santa goes on to point out that this is all just an implementation of
81+
[Conway's Game of Life](https://en.wikipedia.org/wiki/Conway's_Game_of_Life). At least, it was, until you notice that
82+
something's wrong with the grid of lights you bought: four lights, one in each corner, are stuck on and can't be turned
83+
off. The example above will actually run like this:
84+
```
85+
Initial state:
86+
##.#.#
87+
...##.
88+
#....#
89+
..#...
90+
#.#..#
91+
####.#
92+
93+
After 1 step:
94+
#.##.#
95+
####.#
96+
...##.
97+
......
98+
#...#.
99+
#.####
100+
101+
After 2 steps:
102+
#..#.#
103+
#....#
104+
.#.##.
105+
...##.
106+
.#..##
107+
##.###
108+
109+
After 3 steps:
110+
#...##
111+
####.#
112+
..##.#
113+
......
114+
##....
115+
####.#
116+
117+
After 4 steps:
118+
#.####
119+
#....#
120+
...#..
121+
.##...
122+
#.....
123+
#.#..#
124+
125+
After 5 steps:
126+
##.###
127+
.##..#
128+
.##...
129+
.##...
130+
#.#...
131+
##...#
132+
```
133+
After `5` steps, this example now has `17` lights on.
134+
135+
In your grid of 100x100 lights, given your initial configuration, but with the four corners always in the on state,
136+
**how many lights are on after 100 steps**?

0 commit comments

Comments
 (0)