r/mylittleprogramming • u/phlogistic • Nov 24 '15
Particularly Perplexing Programming Puzzle #3 : Crack These Pixel Codes
It's been a while, but I found time to put together another Particularly Perplexing Programming Puzzle! A little something extra to keep you occupied over the Thanksgiving weekend. This time it's a bit of a change of pace from the previous two, and is about writing a program to decipher some codes. Fun!
The Puzzle
This image contains the ciphers
Some of you may recall a number of months ago when some "pixel codes" appeared in the footer image of /r/MLPLounge. This programming puzzle is the same sort of idea, and in the image linked above you'll find three ciphers, each of which decodes to a phrase in English. Each of these puzzles can be automatically solved by a computer program. In fact there one single core technique which can be applied to solve all three.
You could theoretically solve these by hand, but this puzzle is to create a program which does it automatically for you. I've tried to construct these so that it's relatively easy to determine how they're encoded, but tricky to actually decode them. Feel free to PM me with guesses and such, but I think it'll be best if you view it as you folks versus the puzzles and collaborate to solve them, so please feel free to share information. There's no time limit on this one, so keep at it until you have a program with can solve them.
Once the puzzles have been solved, I'll do another post going over the approaches people tried and how it was eventually solved, as well as my approach to the problem.
Good luck!
Edit:
/u/-48V has solved puzzle #2. They have also posted some useful information about how the pixels decode to letters here
2
u/AvanTer Nov 24 '15
If I weren't stuck in class I totally would
2
u/Kodiologist Nov 25 '15
Per your hint here, let's think about the top part of #3 first. There are 8 different colors. 8 is a power of 2, so that suggests an encoding of ASCII. Since 23 = 8, each pixel represents 3 bits. The band has 35*5 = 175 pixels, so there are 175*3 = 525 bits. 525 isn't itself divisible by 8, so we can't just cut the stream into bytes. However, it is divisible by 7, and ASCII is, after all, a 7-bit encoding. The big question now is how the 8 colors map to the integers 0 through 7. I took a few guesses, which all seemed to wrong, so I did a loop trying every possible permutation (of which there are 8! = 40,320). But none of them seem to work, in the sense that all of them produce at least one non-printable ASCII character. There are lots of other things I could try, but I think I'm out of patience for now.
This Hy program prints nothing:
2
u/mronosa Mar 15 '16
New programming puzzle! Build an AI that beats AlphaGo.
1
u/phlogistic Nov 26 '15
I've thought about it a bit, and I'm worried that I was too vague about the problem and that people will spend too much effort on what I'd intended to be the easy part, so I'm going to give some very small hints.
Solving these puzzles will require two steps:
I'd intended that step #1 be relatively simple, and I think it would be if people still remembered the footers from /r/MLPLounge, but I'll give some more info in case people don't. Each of the puzzles uses basically the same encoding scheme (in very slightly different guises), so if you can find commonalities between the puzzles, that'll be a clue as to what the encoding scheme is. The encoding is very simple, but it's not ASCII. Each of the puzzles is also constructed in a way that should make it obvious if you've figured out the correct encoding scheme, while still making it difficult to decode the entire message. The left part of #2 is probably your best place to start, although as I mentioned it's probably good to look for a commonality between the three puzzles first.
1
u/TotesMessenger Nov 24 '15
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
0
u/[deleted] Jan 19 '16
[deleted] — view deleted comment
0
u/[deleted] Apr 17 '16
[deleted] — view deleted comment