ocr
The second Python challenge presents a picture of a book and the hint;
recognize the characters. maybe they are in the book,
but MAYBE they are in the page source.
In the page source you find a huge mess of symbols, having solved this before I knew that there was a text message buried in there. Previously I simply replaced each common symbol with nothing which eventually revealed the message. This time I went the other direction.
#!/usr/bin/ruby mess=''' <-- a huge mess of symbols for a thousand or so lines -->''' i = 0 message = "" mess.length.times do if mess[i,1] =~ /^[a-z]/ message = message + mess[i,1] end i += 1 end puts message
And this brings us to challenge 3 and the picture of the candles.
** edit
After completing that one I got to thinking about how similar the two challenges are, they both deal with string methods. I figured I could probably apply the one-liner from the first challenge and came up with this;
puts mess.tr ‘!~@#$%^&*()_+[]{}’+”\n”, “”
This is basically the first aproach I took when solving this puzzle with python, though I think that it is a lot more susinct. It took me a minute to figure out the newline problem, single quotes mangle the newline , but double quotes don’t escape the special symbols.