First part was a variation on the "Game of life" a...

# advent-of-codel

littlelightcz

12/18/2018, 12:27 PMFirst part was a variation on the "Game of life" and Part B I did with a little of math magic inspired by **@andyb**'s thoughts from one of the previous days 🙂

a

andyb

12/18/2018, 12:30 PMHow did you get the hardcoded values of 610 & 28?

l

littlelightcz

12/18/2018, 12:33 PMfirst I plotted a graph to find out whether it starts oscillating or not, and if yes (and it did), I picked the period size by hand + offset from which point it oscillates. That was all 🙂 . My first thought was it will settle at some value, but this time it wasn't the case.

a

andyb

12/18/2018, 12:35 PMFair enough, I did it programmatically & wondered if there was a mathematical way of calculating these values.

g

Gerard Klijs

12/18/2018, 12:35 PMMine is 28 as well, but somewhere before hitting 500. I toke 'snaphots' at the 100th..200th.. iteration and each iteration compared to the snapshots worked fast enough

a

andyb

12/18/2018, 12:37 PMI think 28 is common but it took me longer to reach this state.

g

Gerard Klijs

12/18/2018, 12:39 PMI just tried my own one, and I only know it was 28 because I had an off-by-one error in that part of the code.

l

littlelightcz

12/18/2018, 12:40 PMI think it should be possible to construct some polynomial which would yield the correct result for any number since oscillation onward, but I am not that crazy to try to do such thing 😁

8 Views