Hi! I'm trying to use Polygon to create some problems, but I'm having difficulties running the code on my machine (Linux, not Windows). I downloaded the Package on Polygon, and there are several scripts (do-all, gen-answer, ...), but no instruction on how to use them. I tried the Help page on the Polygon website, but the link is broken. do-all seems to generate all the tests, but I don't know how to test some code my friends wrote. If it wasn't clear, I have an a.cpp file, and I want to test if it is a correct solution. Is there something on Polygon that helps with that? Or should I do this manually? (And if so, how can I do it safely so some code doesn't mess up my machine?)
Any help or links would be great.
Thank You!
Why not test in Polygon instead of locally?
Me and some friends are trying to create a small online judge, is it possible to use Polygon to test the solutions instead of doing it locally?
No, I don't think Polygon is compatible with anything but CF, at least not in a way that isn't very convoluted. Anyway, I see multiple philosophical problems with it:
Why would you make ONE MORE? There are countless OJs already, what's the point? If it's to try and make something, then make something which doesn't exist yet.
Making an OJ that uses another OJ is half-assed — if you really want to do it, then make everything necessary.
There aren't many good OJs in my language, and we're doing it as a project for our university, with hope to keep the coming freshmen training. I thought Polygon was meant to help with this kind of stuff, but if it's not we won't use it, of course.
The language of the programming world is English, so people should train English as much as programming.
But still, the fact that CF and Polygon are primarily English doesn't prevent you from using any language in problem statements, preparing problems in Polygon and making your own university's group in CF where you can use those problems, in any language you want. That's a simple solution.
If you want to make your own OJ, go ahead, but I don't think it's worth it. Efficiency...
Can you answer me what is the difference between purple and red on codeforces?
One has higher rating and different colour.
Here's another one: what's the difference between a horse and a mole?
Well, I don't know but I think this link can be useful: http://goo.gl/FE8QVI
And it finds shit like "mule vs mole". At least I know it's not googlable.
The answer is: both live underground. Except the horse, of course.
Ok, I got it. So we are both silly, except me, of course. hahahahahah
No, we are both shitposting. And this is now a Spiderman thread.
http://www.wolframalpha.com/input/?i=horse+vs+mole
Quite good comparison
Generally Xellos is right, but if it's your university project, this is how online judges work (you should write a script for that):
./solution < input > output
, checking if the process exceeds the time and memory limit (I personally don't know how to do that). If the run is successful, the program outputs something in the output file. Now the checker starts his work. The exact usage can be found in testlib.h, it's something like./checker input output juryOutput
. When the checker finishes, you should check its exit code. If it's 0, the answer is correct, otherwise checker outputs something and returns the different exit code, the full list is also available in testlib.h.Also you must take care of the security issues, that's one more thing I don't know how to do.
If you haven't considered it yet I would propose using a Hackerrank API to test submissions, that might be a good solution unless you really want to invent everything on your own.
If you need to use API , i personally prefer ideone APIs than HR's but you will need internet.
Therefore, its obviously preferable to have offline judge. Here are few open source judges ,you can either use them directly or learn if you wish to create your own .
Mooshak | DOMjudge | Codejudge | Aurora
I can also pm you source code of my judge if you want , though its quite shit,its code its short,sweet & simple :P
I agree with your point on offline solution, but topic starter said this above:
So I'm answering mostly this question.
Have you actually tried to used HackerRank API? Around 1 year ago I had tried, but it took a lot of time to actually get submission results. Uploading large files(upto 2MB) makes it even slower.
I tried it in manual mode uploading some actual solutions there, it was more or less ok. I didn't try uploading big inputs though.