4 ms·
I had a C class in college where we submitted homework with a program on a server. The program would compile the C code, run it with a bunch of inputs, and then
by 8_hours_ago 10y ago
I had a C class in college where we submitted homework with a program on a server. The program would compile the C code, run it with a bunch of inputs, and then report back if it passed (i.e. the output matched the expected output). The output was expected to be in exactly the correct format, so the submit program would helpfully print your output and the expected output so you could fix any formatting issues.
I got about 2 assignments into the class before I realized that I was being a chump. I wrote a C program that simply printed out the expected output, and submitted it. I received a passing grade on the assignment, so I took it further. I wrote a Perl script which would submit "int main(void){return 0;}", read the expected output, generate a C file that printed out that output, and submit it again.
Apparently the TA for the class never checked the submitted assignments and relied entirely on the submit program, so I was uncaught for a few weeks. My downfall was trying to make the Perl script as efficient as possible (I had extra time on my hands because I didn't have to do the C assignments!). I had run my Perl script a few dozen times while optimizing it, and apparently the TA received an email every time an assignment was submitted. He brought it up to the professor and I was called into his office. Luckily he was lenient and let me just redo the assignments :)