On Saturday, 22 September 2018 at 19:09:24 UTC, bauss wrote:
...
It's no rocket science, so it really doesn't do much in
preventing I think.
Really it can be automated like:
1. Copy the code
2. Go to run.dlang.io
3. Paste the code
4. Compile it
5. Wait for the output
6. Copy the output
7. Paste the output into the input field
8. Submit
...
Or since the snippets are simple and some resembling C, the Bot
could run itself or even in JavaScript parsing the body of the
function and taking care of the return, with in the most case are
int or float:
<script>
var v = "int v(){ return 26 % 3 ? 13 / 3 : 42 % 5;}"; //
Original Snippet
var types = ["int", "float"]; // Type of return
var s = v.split(" ");
var t = s[0].toLowerCase();
s.splice(0,1);
if(types.indexOf(t)>-1){
t = t[0].charAt(0).toUpperCase() + t.slice(1);
}
document.writeln(eval("parse"+t+"((function " + s.join(' ') +
")())" ));
</script>
This an example and will print 4 which is the result expected by
the Captcha.
https://js.do/code/241565
S.G