Announcements, comments, ideas, feedback, and "How do I... ?" questions
5 posts • Page 1 of 1
It would be good to have an API to check answers with. My use case is that I run a private GitHub repository with the code for my solutions which is integrated with Travis CI, Coveralls, Codecov, CodeScene, Better Code Hub and DeepSource. I run builds on Travis for each commit. It would be awesome if it was possible for me to add a script which could check the solutions to the puzzles in the builds which would fail if incorrect. Also, it would be useful to generally submit answers.
You can write something up to submit answers for you if you give it your keep_alive cookie (it just has to do the HTTP request to get the problem page, extract a couple of things from that, then send back the solution). I did this recently for a Project Euler app that I'm making. I'm planning to put the code on GitHub once I release the app, but if you're interested in this approach but need more concrete guidance to implement it yourself, let me know, and I'm happy to put my code up sooner and give a pointer to the relevant file.
For that use case you don't want an API: you want a local file with test cases. Otherwise your build can randomly fail due either to temporary network problems or to the PE team deciding to change a parameter in the question in order to adapt the difficulty to improved hardware. (There are a number of questions where it's obvious from the thread that earlier solvers were working against different parameters to the current question).