Page 1 of 1

Automation

Posted: Sun Jun 24, 2007 6:34 am
by adum
Like all our puzzles, this is designed to be solved by a computer past a certain point.

Accessing your current level
The URL for the puzzle is http://www.hacker.org/oneofus/index.php
The URL will accept parameters in the query part of the URL that correspond to your registered account:
name=<username>
password=<password>

Just making a normal HTTP request to the above URL with your name and password will retrieve the current puzzle. To parse this information, look for the line that says FlashVars="...". inside the quotes are params separated by ampersands. The 'board' parameter is the map, where character pairs determine the shapes and colors. (Each 'shape' of block is a different letter, starting with 'A'. Similarly, the 'colors' start with 'a'.) It's all one string, but you can break it up knowing boardX. (The first boardX * 2 characters make the first row, etc.)


Submit a Solution via an HTTP GET:


To submit a solution, use the following parameter:
path=<moves>
where the moves are a sequence of move pairs, two hexadecimal strings each, with a separator of a comma between x and y, and a separator of a '_' between moves.
For example, to submit a solution where you clicked one square over and two down, then three squares over and zero down, you would do an HTTP GET on the following URL:

Code: Select all

http://www.hacker.org/oneofus/index.php?name=<username>&password=<password>&path=1,2_3,0

Posted: Thu Apr 17, 2008 5:54 pm
by adum
hi snark -- yes, you need to use POST. all the puzzles will accept it.

cheers,
adum

Posted: Tue Dec 30, 2008 3:36 am
by coderT
What is POST, can I see an example. (Java version please)
Thanks.

Posted: Sun Sep 20, 2009 1:31 pm
by outsider

Posted: Sun Jan 03, 2010 3:28 am
by coderT
Thank you very much. :roll:

Posted: Sat Sep 04, 2010 8:34 am
by miroe
Hi,

I'm using a programming language which does not allow HTTP sockets or similar stuff. So I thought to use HTML forms with my web browser to post the solutions manually. Works well for the challenge Crossflip, but for OneOfUs, the parameter is not accepted. I'm using:

<html><body><form action="http://www.hacker.org/oneofus/index.php" method="post">
<input type="hidden" name="path" value="22,24_05,24_[....]"><input type="submit" value="Send"></form></body></html>

When I press the send button, my solution is ignored and the same level again is shown. With get, of course the size limitation for the request url comes into place. I tried on IE, Safari and Opera, always with the same result.

Do you have any idea what I could do?

Btw, really great challenges here!

Kind regards, many thanks
Michael

Posted: Sat Sep 04, 2010 10:04 am
by Zeta
Try adding "name" and "password" (or "spw") parameters to your form and prevent sending the session cookies. The POST hander probably doesn't recognize your cookies and somehow forwards the request to the normal GET handler or in presence of session cookies the POST request is not handled correctly.

Out of curiosity: What language are you using?

You may want to investigate some kind of glue language like python, perl or ruby.
On linux you can always use the bash together with curl. Windows has the power shell and you can do .NET scripting using system.net.webclient.

Posted: Sat Sep 04, 2010 3:17 pm
by miroe
Thank you very much! That worked! :D

I'm using ABAP. The only language I know well enough to get some of the challenges solved. I think it contains webclient functionality as well, but I was too lazy to figure out how that works 8) At least, its not as easy as in java, I guess.

Posted: Mon Sep 06, 2010 6:43 pm
by megabreit
You're using ABAP??? That's bizarre :-) Is it usable outside a SAP application server? Or do you have a "home" SAP system running?
I wonder if people do challenges with other "unusual" programming languages like Postscript...

Posted: Fri Oct 10, 2014 8:27 am
by Hippo
megabreit wrote:You're using ABAP??? That's bizarre :-) Is it usable outside a SAP application server? Or do you have a "home" SAP system running?
I wonder if people do challenges with other "unusual" programming languages like Postscript...
It would be real challenge to solve challenges in TeX...