Telecran
I think it's amusing that I actually did this brutally fast in Excel. I typed out U, L, D, or R depending on which way I thought the flags pointed, then imported those into a column into excel. A few if statements and I was able to incrementally change the x and y position and copy the formulas down. A scatter plot of the data points with a connecting line gave me a pretty clear answer. I thought about coding it, but figured why use C++ as a golden hammer?
Yes. No? Perhaps. What?
-
- Posts: 106
- Joined: Thu Oct 29, 2009 9:21 pm
The .png's actually have 'l', 'd', 'r', 'u' in them, IIRC.virstulte wrote:I think it's amusing that I actually did this brutally fast in Excel. I typed out U, L, D, or R depending on which way I thought the flags pointed, then imported those into a column into excel. A few if statements and I was able to incrementally change the x and y position and copy the formulas down. A scatter plot of the data points with a connecting line gave me a pretty clear answer. I thought about coding it, but figured why use C++ as a golden hammer?
-
- Posts: 33
- Joined: Sat Aug 13, 2011 2:13 pm
i need to learn drawing in python lol
Code: Select all
#--#--# | #--#--# #--# | #--#--#--# #--# #--#--#--# #--#--# #--#--# #--#--# #--#--# | |
| | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | |
| #--# #--# #--#--# | #--# | | #--# #--# #--# #--# | | | | #--# | | | #--#--#
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | |
#--#--# #--#--# | | | #--# | #--#--# #--# #--# #--# #--# #--# #--#--# | #--# #--# | | | |
| | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | |
#--#--#--# #--# #--#--#--#--# #--# #--# #--#--#--# #--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--# #--#
##############################################################################################################################################################################
More PHP, wewt. I'm glad the flag names contained U, D, L, R. This one was fun
Code: Select all
$page = file_get_contents('http://www.hacker.org/challenge/chal.php?id=52&name=alakani&password=XXXXXXXXXXXXX');
$lines = explode("\n", $page);
$x = 10; $y = 10; $lastx = 10; $lasty = 10;
$answer = imagecreate(590, 50);
$black = imagecolorallocate($answer, 0, 0, 0);
$white = imagecolorallocate($answer, 255, 255, 255);
imagefill($answer, 0, 0, $white);
foreach ($lines as $line) {
$lastx = $x; $lasty = $y;
if (strpos($line, 'wro.gif')) $x+=10;
if (strpos($line, 'wlu.gif')) $x-=10;
if (strpos($line, 'wdk.gif')) $y+=10;
if (strpos($line, 'wua.gif')) $y-=10;
imageline($answer, $lastx, $lasty, $x, $y, $black);
}
imagepng($answer, 'telecran.png');
stretching is evil
When I finally caught how the countries translate to directions, everything seemed simlpe. As Matlab was running anyway I used it to plot the crane's path. But the picture looked somehow messed up and it took me another day to figure out that the scaling of x and y wasn't identical... funny how asymmetrically stretching an image destroys the readability.
Heheh, I took a low-tech approach: I copied the html source to a document, find and replace with R,L,U,D as appropriate. After trying blocking it out in excel I had a better idea: if the challenge is about an etch-a-sketch, why not use one? Googled for an online version and voila: http://www.ohioart.com/lets_sketch.jsp
After getting "The An" I switched to the end of the instructions and did them in reverse (L=R, U=D etc), and after "tch" it was enough to guess.
Great challenge, loads of fun.
After getting "The An" I switched to the end of the instructions and did them in reverse (L=R, U=D etc), and after "tch" it was enough to guess.
Great challenge, loads of fun.