4 ms·
A few minutes fun diversion. A bit of guess work and trial and error, and I have the following bash one-liner: pngtopnm puzzle.png | pnmtoplainpnm | tail -n +
by maffydub 10y ago
A few minutes fun diversion.
A bit of guess work and trial and error, and I have the following bash one-liner:
pngtopnm puzzle.png | pnmtoplainpnm | tail -n +4 | sed -e 's/232 3 138/A/g' -e 's/58 185 229/B/g' | tr -d ' \n' | sed -e 's/AB/A\nB/g' -e 's/BA/B\nA/g' | awk '/.*/ { printf "%x", length(); }' | xxd -r -p | sed -e 's/-//g' | xxd -r -p
I'm not sure the "sed -e 's/AB/A\nB/g'" bit is optimal, but it was the first thing I thought of...
...and I definitely have a tendency to use sed when I should be using tr.