Programming, Topic: Generators

Recent posts (Page 1 of 2)

Rescuing Gentoos with a Rust Solver (Part 2)

Rescuing Gentoos with a Rust Solver (Part 2)

And here we have Part 2! It’s not been that long for you, but since the first part took six months for me to actually get around to writing it… well, this is much better!

Things get a bit more complicated this time, with buttons that can open/close doors and even holes in the floor and BOMBS. But what’s really crazy is how we actually get around to solving how to get to new sublevels this time… and how to take penguins back out of them. Things are getting complicated!

Here are all of the commits from part 1 up through part 2.

And here are all of the parts in this series so far:

read more...

Rescuing Gentoos with a Rust Solver (Part 1)

Rescuing Gentoos with a Rust Solver (Part 1)

Months ago now1, I started playing Gentoo Rescue (after seeing the Aliensrock video). At the core, it’s a Sokoban style puzzle game where you have to guide cute little sliding penguins to their color coded nests… but oh man does it start getting more complicated quickly.

On top of that, it has a really interesting nesting level concept–the level select screens are levels themselves. You can go several ’levels’ deep into levels or eventually further back out. And that’s just with how far I’ve gotten so far…

read more...

Solving Woodworm

Solving Woodworm

Woodworm is a cute little PICO-8 puzzle game about a cute little worm… that eats wood. You can play it for free right now right here!

The goal is to turn this:

Level 1, before solving

Into this:

Level 1, after solving

There are a few rules to keep in mind:

  • The block (and the worm) are affected by gravity

  • The block can be split by into multiple pieces by eating it completely apart

    Demonstrating gravity

  • The worm can crawl up the side of blocks, so long as two (consecutive) segments of the worm are touching walls

    Demonstrating climbing

And that’s really it.

So let’s solve it!

read more...

Freshly (Frosted) Solved

Freshly (Frosted) Solved

And so it begins.

Freshly Frosted

It’s a cute little puzzle game about making a donut factory.

It’s a lot like Solving Cosmic Express in that it’s a ‘puzzle on rails’, you are basically routing around the grid from source to target. In the way, we have to go to certain tiles in a certain order (in this case, to apply toppings to our donuts).

The first level

Let’s do it!

read more...

Solving Cosmic Express

Another Rust Solvers puzzle: Cosmic Express. Basically, it’s a routefinding puzzle. You have a train that needs a track from entrance to exit, picking up and dropping off cargo on the way.

It’s actual a relatively simple puzzle, so far as things go, but one thing that’s interesting from a solving perspective is that branching paths really don’t work great with my solver code. Paths just have a crazy branching factor when compared to (for example) playing one of a handful of cards.

But it’s still an interesting puzzle!

read more...

The Golf (Peaks) of Solving

The Golf (Peaks) of Solving

Another day (week? month?), another puzzle game.

This time around, we’re going to solve Golf Peaks. I picked this up a while ago on iOS, but only recently on Steam. It’s a cute little puzzle game themed around minigolf.

Basically, you’re on a grid and you have to get the ball (in the bottom in that screenshot above) to the flag (currently at the top). You have a set list of moves you can take, styled as cards–all of which either move a certain number of tiles in a specific direction or possibly jump into the air (and fly over obstacles).

It gets more complicated from there, but hopefully you have the basic idea. 😄

read more...

Solving Sokobond

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...

Stateful Solvers and Iterators

Rust, yet again! Let’s take what we did last time with Solving Sudoku (again) and improve the code structure a bit more.

Goals:

  • Create a ‘Solver’ struct that can maintain state (such as how many states we’ve visited, how much time we’ve spent)
  • Track the above stats
  • Turn the ‘Solver’ into an iterator which will iterate through given solutions (a single call will give the first solution or you can run through the iterator to get all of them)

If you’d like to follow along, I’ve started uploading the code here: https://github.com/jpverkamp/rust-solvers

read more...


All posts