Page 1 of 3

Stuck at level 91? (Server fault?)

Posted: Fri Mar 18, 2011 11:54 pm
by paulw1128
My new solver was just running through Crossflip and has gotten stuck at level 91.

I have a solution (529 characters long), but when I submit it, instead of getting back the page for level 92, I get level 91 again :(

If I try to warp to level 92 it tells me I can't, which suggests that my solution has been rejected either because it's wrong, or because of a problem server side.

My impression is that the server-side stuff is failing, because both these cases fail:
- a solution of all ones doesn't get the 'You can't click at (x,y)!' message
- a solution of all zeroes doesn't get the 'You didn't turn on the light at (x,y)!' message.

However the length check on the solution is working fine.

Has anyone else seen this problem?

Thanks,
Paul

Posted: Sat Mar 19, 2011 10:18 pm
by helly0d
Nope my algorithm is still running, slow for the 390's but still running

Posted: Mon Mar 21, 2011 11:37 am
by paulw1128
Ok, thanks. I guess it's time to write an answer checker, and try to work out how it got this one wrong!

Posted: Wed Mar 23, 2011 10:46 pm
by paulw1128
Update: Made an answer validation routine - it said my answer was correct.

So, to check that I wasn't going mad, I entered it by hand. Thankfully level 91 is only 23x23 so it didn't take too long!

Anyway, having submitted my answer manually, i've now moved on to level 92. This is doing the same thing, so I think I'll update my solver to use HTTP POST instead of GET, to see if that solves the problem. I'm using spw, so the URL for level 91 was >600 characters. Hopefully this is the cause of the problem.

UPDATED: POST works fine. I guess there's some problem with long GET args.

Posted: Thu Mar 24, 2011 7:45 am
by helly0d
I didin't had problems with long gets untill level 223 but that's good you made the change form the beggining.

What method are you using to solve the puzzle ?

Posted: Thu Mar 24, 2011 8:27 am
by paulw1128
I'm using a Gauss-Jordan style elimination in python, with NumPy arrays of bool types. It's not very quick :P

I'll probably move over to C soon, and then look into cache-friendly blocking stuff for the elimination, although the way this is scaling I don't expect that to be enough to get through to the top.

Posted: Sat May 14, 2011 11:10 pm
by jagd
stopped at level 91 too, it was because a '\n' (0x0A) on the end of sol=

Posted: Wed Jun 29, 2011 12:17 pm
by Tenebrar
I'm stuck at level 92, with the same thing apparently (no messages of error, except for too small). I'm trying to send in my solution using java, but when I try using an InputStream it basically just reloads the page, instead of submitting a solution.

If I try submitting using a POST request using a socket, I get:
<p>The requested URL /cross was not found on this server.</p>

Could someone tell me of a way I can make this work in java?

Posted: Wed Jun 29, 2011 1:01 pm
by Tenebrar
I got it to work with:

String host = "www.hacker.org";
int port = 80;
String path = "/cross/index.php";

String data = "name=" + $name + "&password=" + $password + "&sol=" + sol;

InetAddress addr = InetAddress.getByName(host);
Socket socket = new Socket(addr, port);
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF8"));

wr.write("POST " + path + " HTTP/1.1\r\n");
wr.write("Host: " + host + "\r\n");
wr.write("Content-Length: " + data.length() + "\r\n");
wr.write("Content-Type: application/x-www-form-urlencoded\r\n");
wr.write("\r\n");
wr.write(data);
wr.flush();

// Get response
BufferedReader rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// Process line...
System.out.println(line);
}

wr.close();
rd.close();

Posted: Tue Jul 05, 2011 9:07 pm
by laz0r
Sorry for a stupid question (and to break the page!), but I just can't get beyond level 106 even though the solution is definitely correct. Is this CURL usage right? I think it is, but it's not being accepted...

Code: Select all

curl --request POST -d "name=laz0r&password=abcde&lvl=106&sol=000111..." "http://www.hacker.org/cross/index.php"

Posted: Wed Jul 06, 2011 1:49 am
by uws8505
I don't know anything about CURL, but the page will be better to read if you delete the solution part :)

Posted: Wed Jul 06, 2011 6:57 am
by laz0r
uws8505 wrote:I don't know anything about CURL, but the page will be better to read if you delete the solution part :)
Your wish is my command... :)

Posted: Wed Jul 06, 2011 9:22 am
by Zeta
@laz0r: This should work. Analyze the server response.

Posted: Wed Jul 06, 2011 4:36 pm
by laz0r
Zeta wrote:@laz0r: This should work. Analyze the server response.
Bizarrely, it works fine for level 105, but for 106, I get "The answer is too long. It should be 4 characters long."
When I submit something four characters long as the sol parameter, I get 'The answer is too short. It should be 1024 characters long."
Specifying where to store cookies has not done anything.

Posted: Thu Jul 07, 2011 10:38 pm
by MyNameIsAlreadyTaken
I tried your command and it worked for me .


Maybe it works with my script:

Code: Select all

#!/bin/bash

for lvl in {1..643}
do
    echo -n "Receiving sourcecode for lvl "${lvl}"... "
    code=`lynx -source "http://www.hacker.org/cross/index.php?gotolevel="${lvl}"&go=Go+To+Level&name=[your_name]&spw=[your_spw]" | grep var\ boardinit`

    echo "Done"
    
    numbers=`echo ${code} | sed s/level\ =\ [0-9]*// | sed s/[^0-9,]//g`
    if [ -z ${numbers} ]
    then
        echo "No correct Levelcode received"
        notify-send Crossflip "Error occured"
        exit 1
    fi
    
    
    echo -n "Calculating Solution... "
    solution=`./crossflip ${numbers}`
    echo "Done"
    
    
    echo "Solution is "${solution}
    
    echo -n "Submiting solution... "
    curl http://www.hacker.org/cross/ -s -d "lvl="${lvl}"&sol="${solution}"&name=[your_name]&spw=[your_spw]" -o ret.txt
    echo "Done"
    echo
    
done
notify-send Crossflip "Done :)"