Source: Day 4: Printing Department
Full solution for today (spoilers!).
Part 1
Given a grid of solid
@and empty cells., count how many solid cells have less than 4 neighbors.
Full solution for today (spoilers!).
Given a grid of solid
@and empty cells., count how many solid cells have less than 4 neighbors.
Ludum Dare? That’s been a while!
I didn’t actually enter the game jam. Honestly, I wasn’t sure I was going to write anything. But I had a bit of an idea and spent a few hours only on Sunday hammering something out:
Yeah, I did another cellular automata thing 😄
It’s not at all complete, but the basic idea is:
It’s sort of got that?
I’m using Rust as I’ve been doing a lot recently.
The main libraries are:
rwh_05 to be properly compatible with pixels, which took a minute to track downOther than, that, it’s straight custom code which you can see in it’s entirety on my github.
update function; with generation in newI think that perhaps the only really interesting bit about the code is how the ‘shine waves’ work. Basically, I have a grid of the state of each cell, but I also have a Vec that tracks ‘active’ pixels. Those are the only ones that can update–which both helps performance and makes the simulation appear the way it does.
Overall, a nice quick project. More than anything, it actually convinced me to try setting up something that can render pixel buffers on Rust. And with a (very minimal) GUI, too! Both things I’ve been meaning to learn.
I probably won’t do anything more with this code, but it’s got the seeds of something more interesting. Keep an eye out. 😄
Onward!

Spend a month making one beautiful thing per day, given a bunch of prompts. A month late, but as they say, ’the second best time is now'.
Let’s do it!
I like Boids. Here are some Boids with debug vectors drawn showing the three forces acting on them (red to stay away from one another, green to move in the same direction as their friends, blue to move towards the center of their friends).
Implement a cellular automaton with the following rules:
NSWE, SWEN, WENS, ENSW, NSWE, …)Given a series of walls as input, run a falling sand simulation until any new sand falls of the map. Count how many grains of sand we end up with.
Implement a simple virtual machine with two instructions:
nopwhich does nothing for 1 cycles andaddx $nwhich adds$nto theXregister (initial value 1) in two cycles. Calculate the sum ofcycle * Xfor the cycles 20, 60, 100, 140, 180, 220.
Simulate two connected links such that whenever the first link (head) moves, the tail moves to follow according to the following rules:
Count how many unique spaces are visited by the tail of the link.
.), east movers (>), and south movers (v). Each step, move all east movers than all south movers (only if they can this iteration). Wrap east/west and north/south. How many steps does it take the movers to get stuck?