Genuary 2023.05: Debug view

Genuary! 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! 5) Debug view 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).

read more...


AoC 2022 Day 23: Elf Scattinator

Source: Unstable Diffusion

Part 1

Implement a cellular automaton with the following rules:

  • If you have no neighbors, don’t move (important, I forgot this one for a while)
  • Otherwise:
    • Calculate a potential move:
      • If you have no neighbors to the north, move north
      • If not, check likewise for south, then west, than east
    • If no other agent is moving to the same space, move to your potential move
    • Otherwise, don’t move
  • On each frame, rotate the order the directions are checked in (NSWE, SWEN, WENS, ENSW, NSWE, …)

read more...


AoC 2022 Day 10: Interpretator

Source: Cathode-Ray Tube

Part 1

Implement a simple virtual machine with two instructions: nop which does nothing for 1 cycles and addx $n which adds $n to the X register (initial value 1) in two cycles. Calculate the sum of cycle * X for the cycles 20, 60, 100, 140, 180, 220.

read more...


AoC 2022 Day 9: Ropeinator

Source: Rope Bridge

Part 1

Simulate two connected links such that whenever the first link (head) moves, the tail moves to follow according to the following rules:

  • If the tail is at the same location as head, don’t move
  • If the tail is adjacent to the head (orthogonal or diagonal), don’t move
  • If the tail is in the same row/column as the head, move one directly towards it orthogonally
  • If the tail is in neither the same row nor column, move one towards diagonally

Count how many unique spaces are visited by the tail of the link.

read more...


AoC 2021 Day 25: Cucumbinator

Source: Sea Cucumber

Part 1: Load a grid of empty cells (.), 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?

read more...


AoC 2021 Day 11: Octopus Flashinator

Source: Dumbo Octopus

Part 1: Simulate a grid of numbers such that on each tick: advance all numbers by 1, any number that increases over 9 will ‘flash’ and add 1 to all neighbors (recursively, but each cell can only flash once) and then reset to 0. Count the number of flashes in the first 100 ticks.

read more...


Neural Network Cellular Automata

Okay. A random post on the /r/cellular_automata subreddit inspired me.

Let’s generate a cellular automata where each pixel updates based on a neural network given as input:

  • The x/y coordinates (scaled to the range 0-1)
  • An optional random value (to make it more dynamic)
  • A variety of neighboring data, such as:
    • The number of neighbors that are ‘active’ (> 50% white), ranges 0-8 scaled to 0-1. This should allow Conway's Game of Life
    • The RGB values of all neighbors (allows a superset of the above)
    • Gradients, subtract color value of the left from the right so that you get edges and side to side movement

Let’s do it!

read more...