FloodBoard - Learn to See the Game-Board Like a Computer

/images/floodboard-logo.png

I like puzzle games, and one that I’ve always played in a rather mindless way, just to kill time, is the one called Flood It. Or Color Flood. But whatever you call it, it’s the one with a grid of random-colored squares where you start in one corner and keep flood-filling from there in different colors until you’ve flooded the entire board. The fewer moves you make, the higher your score.

But the more I’ve played it, the more curious I’ve become. What is the optimal strategy? Should you always flood as many squares as possible, or is it sometimes better to choose a smaller move to set up a bigger play? And if so, when?

Well, I don’t like just wondering about these things - I want to know. So I wrote a version of the game to help me find out. I call it FloodBoard.

◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇◆◇

To be clear, FloodBoard is not an AI solver. It doesn’t play the game for you. On the surface, it’s just a tool that lets you play the game in a terminal shell. (It also lets you choose how big a board you want to play on. )

But if you’re interested in taking the experience up a notch, you can also use FloodBoard as a training companion. Learn to see the board the way an AI would try to solve it.

The idea

Instead of thinking about the puzzle as a grid of tiles, FloodBoard looks at it differently:

  • Each contiguous block of same-colored tiles becomes a region

  • Each region becomes a node

  • Adjacencies between regions become edges

Mathematically, the board stops being a picture grid and becomes a graph. (This doesn’t change the way the game is played, but it allows FloodBoard to make more useful calculations for solving it.)

And if you can start looking at it that way yourself, the entire puzzle changes.

What changes when you see regions instead of tiles

When you pick a color in FloodBoard, you shouldn’t be thinking “How many squares will I grab?” You should be asking:

  • How many regions will I grab?

  • How many new regions will become reachable after this move?

  • How much future territory does this open up?

  • Will this color be eliminated from the board entirely?

These are the kinds of signals an algorithm uses to judge move quality.

And if you turn on analysis mode, FloodBoard will display these metrics for every possible move.

The idea is not to rely on the display forever. The goal is to learn to predict what it will say before you turn it on.

Playing the meta-game

After a while, something interesting happens. You stop seeing colors. You start seeing frontiers.

You begin to notice that one move only pulls in a small region, but it exposes a huge boundary to another color. You start to anticipate the game state strategically.

Why this is not a solver

An actual solver would take these signals, combine them into a scoring function, and search for the optimal sequence of moves.

FloodBoard stops just before that step, showing you the signals, but leaving you to decide what to do about them.

This is how you to train yourself to master the board.

Command line, by design

FloodBoard runs in a terminal. No fancy graphics, no mouse, no animations. Just a colored board and numbers you type on the keyboard.

That is intentional. Not just to make a fun pasttime playable in the console - but to let you play with the ideas too.

It’s written in Python.

Which means you can mess with the code and add your own algorithms to the pot.

Sound like fun? You’ll find it here.


Read More


/images/MajorDomo.jpg

MajorDomo - A Weather Servant

Weather apps are great at telling you the facts: temperature, wind, humidity, chance of rain… But they don’t tell you what you actually need to know in the moment:

“Should I grab the big coat, the light jacket, or nothing at all?”

Sure, I can see out the window whether it’s raining or not, but temperature? That’s hard to nail down at a glance.

Or at least, it used to be hard.

Now I have a servant for that.

/images/_e1d6c52d-fb38-4336-90ef-7d96d374acfa.jpeg

The Very Slow Game Jam

When I was a teenager, my dad and I would play slow chess. His job involved regularly rotating shift work, which meant that we often went weeks at a time where our days didn’t really overlap. So, to stay connected, we kept a chess board in the kitchen. Every day, Dad would make a move on the board while eating after he got home, and I would make mine after school. It was a fun way to stay connected when our lives were otherwise out of sync.

We didn’t know it at the time, but we were also inventing what would become an important ritual between us.

/images/_9afc0d5d-b13e-4705-a82b-2ec58ea09b29.jpeg

WordFreäk

In order to split the cartoons into beginner and intermediate volumes, I need a way to classify the relative difficulty of the keywords. How am I going to solve that?