Advent of Code, Day 18

This one is just Conway’s Game of Life, so it’s pretty straightforward. Angort’s not the fastest language to do this in, and I’ve written it pretty naively. It runs in around 20 seconds. The grid is a list of lists of 0 or 1, and is actually two grids – like a double-buffered display. Part 2, in which you have to count the cells after a number of generations with the corner lights being hardwired on, was done by turning them on again before and after each generation.

Copyright © Found
Jim Finnis' personal blog

Built on Notes Blog Core
Powered by WordPress