Foxes and Geese - another interactive

Back to General discussions forum

Rodion (admin)     2021-10-09 19:42:44
User avatar

Was thinking of it for some time, at last have found a day to code it. Testing is predictably difficult, but the game comparatively easy (because of lacking diagonal moves and because foxes are not very clever this time).

Please feel free to tell your opinion. I have a mind to add "advanced" version (13 geese, diagonal moves and single fox, though using something closer to proper minimax).

Foxes and Geese

Quandray     2021-10-11 13:46:34
User avatar

I've completed Bear Hunt, but with this problem I get "error: Bad token" with my first POST containing something like
token=...&start=1&geese=au

Rodion (admin)     2021-10-11 14:51:16
User avatar

Grae, hello!

Do you send header with Content-Type:application/x-www-form-urlencoded in the request? I poorly remember how the data format is detected - shall check quickly.

UPD ok, seemingly currently the code detects format depending on header, as I suppose, but let me a few minutes and I'll try to modify it so it can hopefully autodetect. This should be more user-friendly...

Quandray     2021-10-11 15:15:39
User avatar

Hi Rodion, I'm not sending that header, but what I'm doing worked for Bear Hunt and Say 100

Rodion (admin)     2021-10-11 15:25:48
User avatar

Grae, hello once more!

(looked at your code for bear - really there was no header - no idea how this worked... yet... will investigate)

However just updated the parsing function a bit so that it should be "more intelligent". Please try again - perhaps it would behave better now.

Quandray     2021-10-11 15:34:02
User avatar

Thanks, I'm getting past that bit now.

Quandray     2021-10-11 16:02:06
User avatar

Everything working ok now, but you may want to delete my solution, as I just played the game manually!

Rodion (admin)     2021-10-11 16:05:50
User avatar

Ha-ha-ha :) No, I guess, let's keep it - it is significant amount of code anyway and it clearly says about manual approach.

I also only played it manually (though using curl command-line tool to send requests).

Thanks for testing and that feedback about format detection. These tasks were neglected for quite some time (due to difficulty of updating them in google infrastructure), but hopefully we can now improve them by and by. And it seems instruction needs to be updated too.

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