Some professors love challenging students to think outside the box, right up until somebody ventures much farther outside it than expected.
When an assignment rewards creativity and explicitly encourages every trick imaginable, the cleverest solution may look nothing like the one the instructor had in mind.
One computer science student encountered exactly that situation in a 2009 hardware course taught by a former AMD engineer.
The professor had spent years boasting that nobody had completed his famous memory-testing assignment in fewer than 13 lines of assembly code.
Determined to break the record, the student studied how the processor handled instructions and noticed a loophole hidden inside the assignment rules.
The resulting program technically contained zero counted lines of code and initially left the professor admitting defeat.
Scroll down to see how the trick worked and why the rules mysteriously changed afterward.
A computer science student finds a loophole to beat his professor’s legendary coding challenge with zero lines





























































































Few academic victories feel better than discovering that the person who challenged everyone to “get creative” did not anticipate just how literally one student would take those words.
This student was not merely trying to finish an assembly-language assignment.
He had been handed a long-running intellectual contest, told that 13 lines was the legendary record, and explicitly encouraged to use any trick imaginable.
Finding a way to produce a functioning submission that technically contained zero counted lines therefore felt like solving the puzzle hidden underneath the stated puzzle.
Psychologically, the disagreement comes from two definitions of success.
The professor apparently intended students to optimize an assembly program while remaining within an unstated convention about what constituted legitimate code.
The student instead examined the written constraints themselves.
Because DCB declarations explicitly did not count, he encoded the program’s machine instructions as data and exploited the execution model to run them.
When the professor later called this cheating, the student understandably saw moving goalposts rather than clarification.
There is a fresh perspective here, though: the professor’s eventual rule change actually validates part of the student’s achievement.
In engineering and computer science, finding an unintended edge case is valuable information.
A specification that permits an undesirable result is incomplete.
The student’s solution did not merely optimize the program; it effectively performed an adversarial test of the assignment specification.
The student solved the assignment that was specified, while the professor believed he should have solved the assignment that was intended.
Changing the rules for future classes would have been completely reasonable.
Retroactively erasing the achievement is harder to defend after explicitly declaring that virtually any trick was acceptable.
A better teaching response might have been: “You found a loophole. You win this version; nobody gets to use it next year.”
And perhaps that is the most fitting outcome anyway. The student wanted to update the professor’s story.
He succeeded, even if the new story became the reason the rules had to change.
Take a look at the comments from fellow users:
These Redditors criticized professors for changing rules after students had already won fairly

























































This group felt the student deserved the victory and hoped the professor did not punish them afterward






These Redditors focused on the technical loophole that allowed executable code to hide inside supposedly excluded lines






The professor invited creativity, declared that DCB didn’t count, and said there was effectively no cheating, so the student treated the assignment like the hardware itself: follow the literal rules, not their intended meaning.
Zero lines may have violated the spirit of the contest, but changing the rules afterward also makes that original victory difficult to erase.
At minimum, it demonstrated exactly the kind of low-level understanding the course was supposed to teach.
Do you think the professor was right to revoke the record, or was he simply outsmarted by his own rules?
















