var s = document.getElementsByTagName('img')[1];
var w = s.width, h = s.height;
var canvas = document.createElement("canvas");
canvas.width = w;
canvas.height = h;
var ctx = canvas.getContext("2d");
ctx.drawImage(s, 0, 0);
var cw = w / 16;
var ch = h / 16;
var x, y;
var txt = '';
for (y = 0; y < ch; ++y) {
var b = '';
for (x = 0; x < cw; ++x) {
data = ctx.getImageData(8 + (x * 16), 8 + (y * 16), 1, 1).data;
if (data[0] == 230) {
b += 1;
} else {
b += 0;
}
}
txt += String.fromCharCode(parseInt(b, 2).toString(10));
}
console.log(txt);
this one took me a long time, because i thought of these old Punched Tape coded in baudot. It took a while until I figured out that it is just 8-Bit-ASCII....
For y = 120 To Picture1.Height Step (16 * 15)
b = 0
p = 7
For x = 120 To Picture1.Width - 120 Step (16 * 15)
If (Picture1.Point(x, y) And &HFF) = 230 Then b = b Or (2 ^ p)
p = p - 1
Next x
sstr = sstr & Chr(b)
Next y
Clipboard.Clear
Clipboard.SetText sstr
You paste the picture into the box, and the answer goes in clipboard. For non-VB users, each pixel = 15 'twips'.
That's what I tried at first, but how did you manage to keep your hacker.org session going for that? I had to get the file's contents through fopen, just so I could send my Cookie: header along. :]
Am I the only one that learned to quickly read and translate the images? I'm too lazy to write code when it's not needed, and it probably took less overall time than writing out a script
browni3141 wrote:Am I the only one that learned to quickly read and translate the images? I'm too lazy to write code when it's not needed, and it probably took less overall time than writing out a script
Wow, you have returned to the site ... 5 challenges solved recently ...