Problem 176 - getting the right answer but always losing the game - Python3

Back to Problem Solutions forum

Thorin Schmidt     2016-04-07 15:42:13
User avatar

I know this is similar to another post. I'm having the same problem, but with Python3.

I think it might be due to changes in httplib2, but I'm not really sure, since I can post the token just fine:

http = httplib2.Http()
data = "token: " + input() + "\n"
serverURL = "http://codeabbey.sourceforge.net/say-100.php"
response, content = http.request(serverURL, "POST", data)

this retrieves the "secret: XX" content. without any real guidance from the web, I've been doing lots of things, but the closest I get to success is by:

data += "answer: " + str(value) + "\n"

this will give the "end: game is lost" content. I've tried messing around with urlencode(), and a few other things, but I'm at a loss to figure out what is going on at the server.

Any advice would be appreciated. I feel like I'm overlooking something simple.

Thorin Schmidt     2016-04-07 17:55:12
User avatar

Good Grief.

It WAS something very very simple. It all boiled down to an inccorectly spelled identifier.

Please login and solve 5 problems to be able to post at forum