Internationali­zation Puzzles

8-bit unboxing

TOPlap has been producing software for a very long time. TOPlap software is currently a cloud-hosted application, but before that each customer would download and install it on their own servers. Going back earlier, TOPlap software was a Windows desktop application, burned on CD-ROM and packaged in a big cardboard box. And in the very beginning, it was an MS-DOS program, distributed on floppy disks.

You are curious about the early history of TOPlap, and go on a quest to find a copy of the early DOS version. Nobody knows if it still exists, but maybe it's in the archive in the basement? You go down to the basement of the office tower. The label 'archive' is really not appropriate for the big mess you encounter there. How can you find anything? You have to wade through overflowing archive cabinets, boxes of pens and notepads with old logos, stacks of mis-burned CD-ROMs, and, for some reason, a single rowing oar. After shifting through piles of junk, you find, in a large box in the corner, an old forgotten IBM PC/AT from the eighties, complete with CRT monitor and mechanical keyboard.

You shove away some more boxes to create space. You stack up some other boxes as makeshift chair and desk. You plug the PC into a nearby wall socket. Would it still work? You flip the switch.

(For atmosphere, play this video.)

It works! MS DOS loads properly from the venerable 20Mb hard disk. There is also a floppy disk stuck in the 5¼" drive. Would this be the legendary TOPlap version 1.0? You type:

CD A:
DIR

Alas, it is not. It turns out to be a DEMO disk for an old game called PIPES1. But you're curious anyway. You type:

PIPES

And the game starts. It's easy enough to understand. You see a network of pipes, but the sections of pipe are all jumbled up. Each segment of pipe must be rotated in the correct way so that it lines up with its neighbors, up, down, left and right. Commanding your little smiley face avatar with the cursor keys, you can rotate each pipe segment. Once all pipes are connected and there are no more leaks, you get a little animation of the pipes filling with liquid and you move on to the next level.

The game is a lot of fun, and for some time, you are completely captivated. You play for at least an hour, when your growling stomach reminds you of the outside world.

When you step back for a moment, it suddenly occurs to you that the game is completely made up of text. It's making clever use of DOS Code page 437 a.k.a. CP437, to draw the player and pipes. CP437 is an ASCII extension that included support for western accented languages, mathematical expressions, tables, frames, and yes, even game characters. PIPES made clever use of the so-called box drawing characters to present a game arena in a monospace font.

All characters from CP437 made their way into Unicode. For example, take the character , character 218 in CP437, or U+250C in unicode, which can be used to represent the top-right corner of a frame. In the game, you can rotate it clockwise, to go through the characters , , , and back again.

But that's not all. There are also characters for double-lined frames (e.g. ) and even some combinations (e.g. )

As an example, your test-input is a section of the game represented in CP437 encoding. To view it properly, you must first convert it to UTF-8, or open it in a CP437-capable editor, after which it looks like:

└──┐     ┘┬┐
└──┘     ─││
└─│││──┘τ┘┘│
■┌╞──│─┐  ┘┐
 ─═╔╔┌│─│─┴┐
 │═╗╠│½    │
┌┘╗║╝─°    │
└──││┐     │

To solve the game, you must rotate each pipe section such that it lines up perfectly with the neighboring cells, creating a connected path from the top-left to the bottom-right. There are a few non-pipe decorative characters (such as ½ and ) which you can safely ignore. Your full puzzle input also includes a decorative frame which you may ignore as well.

└──┐     ┌┬┐
┌──┘     │││
└──────┐τ└┘│
■┌╥────┘  ┌┘
 │║╔╗┌────┴┐
 │║╚╣│½    │
┌┘╚═╝│°    │
└────┘     │

To go from the start state to the solved state, you must do exactly 34 clockwise rotations.

Your puzzle input is a complete screencap from the game, encoded in CP437, including decorative frame (which you may ignore). What is the minimum number of clockwise rotations you have to do to complete the level?


  1. Thanks to Krisz, Jalitha, Floris and Dawid for providing inspiration for the pipes game. 

To play, please log in with one of these options:
GitHub Login | Google Login