Write a program that accepts the source code of a program, and rewrites it to perform better, or adds new features. The output source must be significantly altered. The program must also accept it's own source as input. Applied iteratively, the program must not exhibit behavior of local maxima that plagues genetic algorithms within the first 10 iterations.
Difficulty: Moderate
Language: Any language is acceptable
Deadline: 2013.28.02
Prize: The winner will receive 15 BTC upon verification and a gift certificate to Shapeways, so that you may print your own trophy, and a years supply of Tab soft drink. Second place will receive 10 BTC and a glow-in-the-dark meme t-shirt from Hot Topic. Third place will receive 5 BTC and a free electronic copy of SICP. Last place will receive a 4chan Pass, so that s\he may return to the imageboards.
Judging criteria: Submissions will be judged first on their completeness, then on the efficiency of the outputted code, and finally on the elegance of both the program itself and the code that it outputs. Should any major bugs be found after submission, the submitter must resubmit his\her code in its entirety.
int main(int argc, char * args[])
{
char p0[] = "\n\n/*\n\tAn enhancement function to add features to this program.\n\tAdded at ";
char p1[] = " UNIX time\n\tBy 4ut0c0d3™ Super Turbo Holocaust Demonic Serial Killer Apocalyptic"
" Nuclear Nazi Jewish Illuminati Rapist Edition\n\tVersion 666, Build Number 88.14"
" \n\tLicensed under the terms of the GPL. \n*/\n";
char p2[] = "int suck_";
char p3[] = "_dicks()\n{\n\tint i;\n\tfor(int i = ";
char p4[] = "; i > 0; i--)\n\t{\n\t\tprintf(\"I sucked a dick just now. Total dick count:";
char p5[] = "\",i);\n\t}\n\treturn ";
char p6[] = ";\n}\n\n";
int rr;
FILE *f;
int t = time(0);
srand(t + rand());
rr = (rand() | (rand() << 2)) ^ (rand() & (rand() >> 2));
f = fopen(args[1], "a");
fprintf(f,"%s%d%s%s%d%s%d%s%%d%s%d%s",p0,t,p1,p2,rr,p3,rr,p4,p5,rr,p6);
fclose(f);
return 0;
}
Alright, where's my fucking money?
Name:
122013-02-11 2:13
And by that I meant #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int main(int argc, char * args[])
{
char p0[] = "\n\n/*\n\tAn enhancement function to add features to this program.\n\tAdded at ";
char p1[] = " UNIX time\n\tBy 4ut0c0d3™ Super Turbo Holocaust Demonic Serial Killer Apocalyptic"
" Nuclear Nazi Jewish Illuminati Rapist Edition\n\tVersion 666, Build Number 88.14"
" \n\tLicensed under the terms of the GPL. \n*/\n";
char p2[] = "int suck_";
char p3[] = "_dicks()\n{\n\tint i;\n\tfor(i = ";
char p4[] = "; i > 0; i--)\n\t{\n\t\tprintf(\"I sucked a dick just now. Total dick count:";
char p5[] = "\",i);\n\t}\n\treturn ";
char p6[] = ";\n}\n\n";
int rr;
FILE *f;
int t = time(0);
srand(t + rand());
rr = (rand() | (rand() << 2)) ^ (rand() & (rand() >> 2));
f = fopen(args[1], "a");
fprintf(f,"%s%d%s%s%d%s%d%s%%d%s%d%s",p0,t,p1,p2,rr,p3,rr,p4,p5,rr,p6);
fclose(f);
return 0;
}
I'm just wondering: have you guys ever craved cock so badly that you found yourself running around outside, howling at the moon for it? Literally ROARING at the top of your lungs, wanting nothing less than a dick's head churning against your glottal stop?
Tell me I'm not alone.
Name:
Anonymous2013-02-11 10:40
What's a BTC?
Name:
Anonymous2013-02-11 10:50
Making it perform better is plausible, but trying to think of a way to have it add new features automatically (or by reading some sort of schema) is making me want to throw up.
Help.
Name:
Anonymous2013-02-11 12:27
Write a program that accepts the source code of a program, and rewrites it to perform better, or adds new features
LOL, perl has been doing that for ages.
Now excuse me while i shitpost somewhere else
Name:
Anonymous2013-02-11 13:06
I wrote GCC so someone could make a better compiler. Does that count?
What sort of stupid challenge is this? This requirement is as vacuous as what my managers ask me to do.
Name:
Anonymous2013-02-11 16:36
>>23
Your managers often ask you to either solve the halting problem or create strong AI? You either work at a very bad place or a very, very good one.
Name:
Anonymous2013-02-11 17:05
Second place will receive 10 BTC and a glow-in-the-dark meme t-shirt from Hot Topic.
Too risky. Not entering.
Name:
Anonymous2013-02-11 17:29
#include <stdio.h>
#include <time.h>
int main() {
sleep(100);
puts("Your program is shit. Please rewrite it in Lisp.");
return 1;
}
Compile with cc minddicks.c -o mentidicks.
Run it as ./mentidicks filename.java filename.py filename.rb filename.js
Only accepts non-Lisp programs. Feeding it a Lisp program will cause undefined behavior.
Please send the prize to rabbiarthurmurray@jewhoo.com
>>31
code = raw_input('Please paste the source code here:')
if '(((((((((((((((((((((()))))))))))))))))))))))))))))' in code:
print 'good goy'
else:
print 'rewrite it in LISP'
Name:
Anonymous2013-02-11 21:16
>>32 You have been disqualified for the following reason(s): Inelegance, also, it performs no operations on code. Submissions must provide more than mere commentary.
Also, I was just wondering: have you guys ever craved cock so badly that you found yourself running around outside, howling at the moon for it? Literally ROARING at the top of your lungs, wanting nothing less than a dick's head churning against your glottal stop?
Write an AI that can read a piece of code, understand what it does, then rewrite it more efficiently while also adding on new features Difficult: Moderate Moderate
OP are you sure you actually understand what you're asking here? I mean, fuck, the best work I've seen in this couldn't do much more than warn me when a piece of code I wrote might write past the end of a buffer.
>>36
This is a pretty easy task for most here actually. If you were as good as you claim to be, you'd already have a few solutions in mind. I'm not going to submit mine because unless you all sign an NDA though, as it contains secrets vital to my career.
hmmmmm it's a good challenge, but i don't think anyone has really managed to do this yet.. even just getting a piece of code to understand varX + 1 seems like it would need quite a few tricks
Surely it's not impossible though =)