Solving Sokobond

Another solver that I’ve been working on, after A Good Snowman Is Hard To … Solve?. This time, we have Sokobond! It’s a Sokobon… but with chemical bonds! Yeah, that’s a really good title.

The basic idea is you have a field of elements with (chemical accurate) free electrons):

A basic level

Here we have 4 hydrogens (1 bond each) and a carbon (4 bonds). It should seem pretty obvious that the carbon should end up with a hydrogen on each end. The one last bit of interest: the element with the dashed border is the one we actually control, that will never change.

This eventually gets more complicated, adding:

  • Modifiers that are placed on the map between squares:
    • One that strengthens bonds, turning a single bond into double into triple
    • One that weakens bonds, turning triple to double to single or breaking single bonds
    • One that rotates bonds as you move by it
  • More elements, eventually hydrogen (1), oxygen (2), nitrogen (3), carbon (4), and helium (0)
  • Solutions that require forming multiple elements at the same time

It’s a pretty neat puzzle game with 144 levels of increasing difficulty. Perfect to solve.


read more...


A Good Snowman Is Hard To ... Solve?

I enjoy puzzle games. I especially enjoy letting computers solve them for me 😄. Once upon a time, I set up a framework for solving random things. Let’s solve some more.

Today: A Good Snowman Is Hard To Build

It’s a Sokoban about making snowmen! You can push snowballs of three sizes around, collecting snow if you roll over it. You can push smaller snowballs onto bigger ones, stacking them. Or back off, in order to get around one another.

And that’s really it.

There are some interesting twists (multiple snowmen, the ability to leave and re-enter levels, and even a whole second ‘hard mode’), but at a basic level, it’s just pushing.

read more...


AoC 2023 Day 22: Block Dropinator

Source: Day 22: Sand Slabs

Full solution for today (spoilers!)

Part 1

Given a series of 3D blocks, allow them to fall until the simulation is stable. Any cube of a block is sufficient to support another block, ignore rotations etc.

How many blocks are not the sole supporter for any other block?

read more...


AoC 2023 Day 20: Flip-Flopinator

Source: Day 20: Pulse Propagation

Full solution for today (spoilers!)

Part 1

Simulate a virtual circuit with high and low pulses and four kinds of chips:

  • Broadcast - Re-transmit all pulses
  • Flip-flops - On a low pulse, toggle internal state; if it was on, send high; otherwise send low
  • Conjunction - Remember input from each attached module; if all inputs were high, send a low, otherwise send high
  • Output - Do nothing; just receive pulses

Count the product of low and high pulses sent after 1000 low inputs to broadcaster.

read more...


AoC 2023 Day 19: Assembly Lininator

Source: Day 19: Aplenty

Full solution for today (spoilers!)

Part 1

You are given a series of parts with 4 ratings as such:

{x=787,m=2655,a=1222,s=2876}

In addition, you are given a series of rules describing a graph as such:

px{a<2006:qkq,m>2090:A,rfg}

In this example, if you are at the node px, if a < 2006, move to qkq. Otherwise, if m > 2090 move to A. If no other case matches, the last defaults to rfg.

A and R are special cases for accept and reject.

Calculate the sum of sum of all four ratings for all nodes that end at Accept.

read more...