This story begins in the quiet coastal village of Port Syntax. You were helping your father manage The Debugger’s Inn, a run-down hostel frequented by odd sailors, rogue coders, and self-proclaimed techno-nomads. Among them, none cast a longer shadow than Captain Byte Beard.
He was a hulking figure draped in patchwork coats sewn from fraying cables and motherboard fragments. His presence was both magnetic and foreboding, as if he carried secrets encrypted within his very soul. Every evening, he’d commandeer a dimly lit corner, regaling patrons with stories of mythical treasure said to be buried on a faraway tropical island.
For months, the captain lingered in the corner of the inn, tapping away on a portable device that hummed like a sea shanty. One fateful night, after a particularly heated argument with a rival coder over "Deletionism and inclusionism", the captain’s health took a turn. He collapsed on his keyboard, his face dimly lit by the RGB glow, leaving only cryptic final words: "Trust the encoding... Follow the bytes... Beware of invalid sequences."
Later that night, you went to tidy up his belongings and found a stack of crumpled dot-matrix printouts in his room. Each sheet bore lines of hex codes printed in the fading ink of a dying ribbon. They were torn in odd places, leaving you to piece them together like fragments of some forgotten assembly code.
You have no way of knowing where these codes might lead, but one thing is certain: destiny has fallen into your hands. You are ready to chase the dream that had eluded the infamous Byte Beard.
At first, you see only nonsense in the codes. But as you examine the fragile pages, certain patterns emerge. Have a look at this sample (your test input):
e295902de295902de295902de295902d
7ec3b1f091808de2898bc3b17e7ec3b1
91808d7ee2898b7ec3b1c3b17ec3b17e
91808d2dc2af7ec3b1c3b1c3b1c3b1c3
2de295902de295902de295902de29597
e2898b7ec3b1c3b1f091808d7ec3b17c
c3b1c3b1c3b1e2898bc3b17e7ee29591
b1c3b1c3b1e288922dc2afc2afc3b17c
808de2898bc3b12d2d2d2dc3b1e29591
808dc3b1c2afc2afe28892c2af2d7e7c
8de2898b7ec2af2d2dc3b1c3b1e29591
898b7ec3b1e2898bc2afe2898b7e7e7c
b17ec3b17e7ee2898bc3b1c3b1e29591
7ef091808d7ee2898bc3b17ee2898b7c
808d7e7e7ec3b17ee2898bc3b1e29591
898b2de288922dc2afe288927ec3b17c
91808d2d2dc2af2dc2af2dc3b1e29591
91808dc2afc2afc2afe288922d2d7e7c
a3e280a22ec2a42de288922d7ee29591
90b3933ac2a42e2ec2afc2afe2898b7c
a32dc2afc2afc2afc3b17ee2898bf091
b2a32dc2afc2af2dc3b1c3b1c3b1f091
90b2a32d2dc2afc2af2d7ec3b1f09180
92c2afc2a4c2afe288922de2898b7ee2
b2a3c2afc2aff090b2a32d2d2dc3b1c3
898b2d2dc2afc2afc2afe2898bc3b17e
91808dc3b17ec2afc3b1c3b17e7ef091
8b7ee2898b2dc3b1e295b37ee2898be2
8b7ec3b1c3b1e2898bf091808d7e7ef0
c3b1c3b17ef091808dc3b17ee2898bf0
e2898b2dc3b1e2898b7ec3b17ef090b2
808d2dc2af7e2dc2afe2898be28892f0
e295942de295902de295902de295902d
7c7ee2898be2898bc3b1c3b1e2898b7e
e29591c3b1c3b1e2898b7e7ee2898bf0
7c7ec3b1c3b1f091808dc3b1e2898bf0
90b393c2a8c2a8c2a42e2d2d7ee29591
90b393c2a42e2ee28892c2af2dc3b17c
90b3932ec2a4c2a42ec2af2d7ee29591
92c2afc2af2de28892c2af2de2898b7c
8b2d2dc2afc2afc2afc2afc3b1e29591
b1e2898b7ee2898b7ec3b12de2898b7c
8bc3b1c3b1c3b17ee2898b7e7ee29591
2de295902de295902de295902de2959d
afc2afe288922df090b2a32d2dc2a4f0
a32d2df090b2a32dc2aff090b2a32ef0
90b2a3e288922de288922d2dc2af2df0
af2df090b2a32dc2afc2af2dc2afe288
922dc3b1c2af7ee2898b7ee2898be289
898be2898b7e7e7ef091808dc3b17ec3
c3b17e7ee2898bc3b1c3b1e2898be289
e295902de295902de295902de295902d
e295917ee2898bc3b17ec2af2df090b2
7cc3b1e2898bc3b1c3b1e288922df090
e29591c3b1e2898b7e7ec2afe28892f0
7c7ee2898bc3b1c3b1f090b2a32de288
e295917e7ec3b1c3b17ef090b2a3f090
7c7ec3b1e2898bf091808d7ee2898be2
e29591c3b1e2898bc3b1c3b1c3b17ef0
7cc3b1c3b1e2898b7ee2898bc3b1e289
e29591c3b17ec3b1c3b1c3b1c3b1e289
7ce2898bc3b17ee2898bc3b1e2898b7e
e295917e7ef091808d7e7ec3b1e2898b
7cc3b1e2898bc3b1c3b1c3b1c3b1f091
e295917ec3b1f091808de2898b7e7ec2
7c7ec3b1c3b1e2898be2898b2df090b2
e29591e2898b7ec3b1f091808d2d2df0
7ce2898bc3b1e2898bc2afc2afc2afc2
e29591c3b1e2898b2dc2afc2af2de288
7ce2898bc3b1c2afc2afc2afe2898be2
e29591c3b17e7e7ef091808d7ee2898b
e2959a2de295902de295902de295902d
Each paragraph represents a fragment of your treasure map. The bytes represent UTF-8. For example, the following piece:
e295942de295902de295902de295902d
7c7ee2898be2898bc3b1c3b1e2898b7e
e29591c3b1c3b1e2898b7e7ee2898bf0
7c7ec3b1c3b1f091808dc3b1e2898bf0
Decodes as:
╔-═-═-═-
|~≋≋ññ≋~
║ññ≋~~≋�
|~ññ𑀍ñ≋�
You can make out some wavy lines - maybe this represents the sea? You can also make out the frayed edges. Clearly this is a corner piece! That's a good start. You also notice that the last two lines are incomplete. The last byte f0
(or 11110000
in binary) is an incomplete UTF-8 character - an error. UTF-8 parsers usually replace errors with �
, the replacement character.
From the UTF-8 specifications, you know that a byte starting with bit pattern 11110xxx
should be followed by 3 more bytes with bit pattern 10xxxxxx
to make a complete unicode character. So, after a bit more puzzling, you find a piece that matches:
e295902de295902de295902de295902d
7ec3b1f091808de2898bc3b17e7ec3b1
91808d7ee2898b7ec3b1c3b17ec3b17e
91808d2dc2af7ec3b1c3b1c3b1c3b1c3
Note that the last two lines start with 91 80 8d
, or 10010001 1000000 10001101
, which matches exactly the binary pattern needed to complete the jagged ends of the first piece.
Putting the two pieces together, you get:
e295942de295902de295902de295902d e295902de295902de295902de295902d
7c7ee2898be2898bc3b1c3b1e2898b7e 7ec3b1f091808de2898bc3b17e7ec3b1
e29591c3b1c3b1e2898b7e7ee2898bf0 91808d7ee2898b7ec3b1c3b17ec3b17e
7c7ec3b1c3b1f091808dc3b1e2898bf0 91808d2dc2af7ec3b1c3b1c3b1c3b1c3
Which decodes to:
╔-═-═-═-═-═-═-═-
|~≋≋ññ≋~~ñ𑀍≋ñ~~ñ
║ññ≋~~≋𑀍~≋~ññ~ñ~
|~ññ𑀍ñ≋𑀍-¯~ññññ�
The larger section contains another incomplete UTF-8 code. The bottom row ends in c3
or 11000011
, which indicates the start of a 2-byte long encoding.
You find a match in this piece:
e295942de295902de295902de295902d e295902de295902de295902de295902d 2de295902de295902de295902de29597
7c7ee2898be2898bc3b1c3b1e2898b7e 7ec3b1f091808de2898bc3b17e7ec3b1 e2898b7ec3b1c3b1f091808d7ec3b17c
e29591c3b1c3b1e2898b7e7ee2898bf0 91808d7ee2898b7ec3b1c3b17ec3b17e c3b1c3b1c3b1e2898bc3b17e7ee29591
7c7ec3b1c3b1f091808dc3b1e2898bf0 91808d2dc2af7ec3b1c3b1c3b1c3b1c3 b1c3b1c3b1e288922dc2afc2afc3b17c
808de2898bc3b12d2d2d2dc3b1e29591
808dc3b1c2afc2afe28892c2af2d7e7c
8de2898b7ec2af2d2dc3b1c3b1e29591
898b7ec3b1e2898bc2afe2898b7e7e7c
Now your map looks like:
╔-═-═-═-═-═-═-═--═-═-═-╗
|~≋≋ññ≋~~ñ𑀍≋ñ~~ñ≋~ññ𑀍~ñ|
║ññ≋~~≋𑀍~≋~ññ~ñ~ñññ≋ñ~~║
|~ññ𑀍ñ≋𑀍-¯~ñññññññ−-¯¯ñ|
��≋ñ----ñ║
��ñ¯¯−¯-~|
�≋~¯--ññ║
��~ñ≋¯≋~~|
Continuing in this vein, you can puzzle together the complete map.
It clearly shows the outlines of some islands, surrounded by sea, with a single ╳
to mark the hidden treasure.
You can assume that your map will always be a continuous rectangle without gaps.
╔-═-═-═-═-═-═-═--═-═-═-╗
|~≋≋ññ≋~~ñ𑀍≋ñ~~ñ≋~ññ𑀍~ñ|
║ññ≋~~≋𑀍~≋~ññ~ñ~ñññ≋ñ~~║
|~ññ𑀍ñ≋𑀍-¯~ñññññññ−-¯¯ñ|
║~≋ñ~¯-𐲣-¯¯¯ñ~≋𑀍≋ñ----ñ║
|ñ≋ññ−-𐲣-¯¯-ñññ𑀍ñ¯¯−¯-~|
║ñ≋~~¯−𐲣--¯¯-~ñ𑀍≋~¯--ññ║
|~≋ññ𐲣-−¯¤¯−-≋~≋~ñ≋¯≋~~|
║~~ññ~𐲣𐲣¯¯𐲣---ññ~ñ~~≋ññ║
|~ñ≋𑀍~≋≋--¯¯¯≋ñ~~𑀍~≋ñ~≋|
║ñ≋ñññ~𑀍ñ~¯ññ~~𑀍~~~ñ~≋ñ║
|ññ≋~≋ñ≋~≋-ñ╳~≋≋-−-¯−~ñ|
║ñ~ññññ≋~ññ≋𑀍~~𑀍--¯-¯-ñ║
|≋ñ~≋ñ≋~ññ~𑀍ñ~≋𑀍¯¯¯−--~|
║~~𑀍~~ñ≋≋-ñ≋~ñ~𐲣•.¤-−-~║
|ñ≋ññññ𑀍-¯~-¯≋−𐳓:¤..¯¯≋|
║~ñ𑀍≋~~¯¯−-𐲣--¤𐳓¨¨¤.--~║
|~ññ≋≋-𐲣--𐲣-¯𐲣.𐳓¤..−¯-ñ|
║≋~ñ𑀍--𐲣−-−--¯-𐳓.¤¤.¯-~║
|≋ñ≋¯¯¯¯-𐲣-¯¯-¯−¯¯-−¯-≋|
║ñ≋-¯¯-−-ñ¯~≋~≋≋--¯¯¯¯ñ║
|≋ñ¯¯¯≋≋≋~~~𑀍ñ~ñ≋~≋~ñ-≋|
║ñ~~~𑀍~≋ñ~~≋ññ≋≋ñññ~≋~~║
╚-═-═-═-═-═-═-═--═-═-═-╝
To get your answer, multiply the x and y coordinate of the ╳
, counted from the top-left corner of the map. In the example, the treasure is at 12, 11, so the answer is 12 * 11 = 132
.
What is product of the x and y coordinates of the ╳
in your puzzle input?
To play, please log in with one of these options:
GitHub Login |
Google Login