FLÄTPÄCK

I made a game. It is called FLÄTPÄCK and it lives at apn201.itch.io/flatpack. You program a robot to walk through a furniture store and do the shopping.

It came from two old ideas that don’t usually go together.

The first is the IKEA store layout. The arrows on the floor, the one long path that drags you past everything whether you want it or not. You go in for a lamp and leave with a plant, three candles and a hot dog.

The second is those programming toys for kids. Bee-Bot, Lightbot, the block coding things. You don’t move the character. You stack up commands – forward, turn, forward – press go, and watch it run.

I put them together. You get a maze that looks like a flat-pack furniture store. You hand the robot a list of blocks. It tries to collect the shopping and reach the checkout. If you got the program wrong, it walks into a shelf.

The daily part

I wanted everyone to play the same level. Like Wordle. One puzzle a day, the same for everyone, so people can compare.

The trick is the seed. The whole maze is generated from the date. Nothing is stored. The string “2026-06-17” goes in, the same maze comes out, every time, on every device. Change the date and you get a different store. This is the old Elite trick. The 1984 space game fit a whole galaxy into a few bytes by generating it from a seed instead of saving it.

So today’s level is just today’s date, run through a maze generator. Tomorrow is a different store. I keep none of them.

Making sure it is solvable

A maze built from random numbers can be cruel. Sometimes an item lands behind a wall with no way in. Nobody can solve that.

I used a maze type that is connected by construction, so every floor tile can reach every other one. Then I put a check on top. Before a puzzle is used, the code confirms every item and the checkout can actually be reached. If not, it tries again with a tweaked seed. I ran a full year of daily puzzles through it. None were broken. The checkout sits between 16 and 48 steps from the door.

Scoring

Fewest commands wins. That is the whole game.

But fewest commands on its own rewards sloppy play. So the score also counts the steps taken, the times the robot walked into a wall, and how many tries it took before it worked. Loops help, because repeating a block costs less than typing forward eleven times. A clean solve beats a brute-force solve of the same maze.

The leaderboard

I wanted a global leaderboard. That needs somewhere to put the scores. I used Firebase.

The thing people warn you about, the API key sitting right there in the code, turns out to be fine. The Firebase web key is a name tag, not a password. The real security is a set of rules on the database that decide who can read and write what. Anyone can read the scores. Anyone can submit one, as long as it is shaped correctly. Nobody can delete.

Could someone fake a score? Yes. It is a furniture maze game with a tip jar, not a bank. The game is fully deterministic, so if it ever matters I can have a server replay the program and check it. For now the rules are enough.

There is a Hall of Fame too. Adding up raw scores is unfair when people play a different number of days. So it counts placements instead. Win a day, five points. Second, three. Top ten, one. It tracks who finishes first most often.

The screen problem

I uploaded it and it looked broken. On the itch.io page you could only see the maze. The buttons were gone.

itch puts the game in a fixed box, and I had turned scrollbars off. So everything below the maze was simply cut off. On desktop the fix was to shrink the map to fit the box and move the controls next to it instead of below. On mobile the page just scrolls. Turning scrollbars back on caught the rest.

What is in it

A new maze every day. A global leaderboard. A Hall of Fame. You can browse old days and replay any of them. A share button that copies your result. A practice mode with random stores.

It is free. There is a tip jar, roughly the price of the meatballs by the exit.

apn201.itch.io/flatpack. New store tomorrow.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *