Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Code that rewrites code [Challenge]

Name: Anonymous 2013-02-10 22:29

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.

Name: Anonymous 2013-02-10 22:30

Prize: The winner will receive 15 BTC upon verification
Wait, really?

Name: Anonymous 2013-02-10 22:31

Difficulty: Halting-complete

Name: Anonymous 2013-02-10 22:33

>>2
Yes. Well, maybe.

Name: Anonymous 2013-02-10 22:33

HALT MY ANUS

Name: Anonymous 2013-02-10 23:00

I want to accelerate my cellular automata.

Name: Anonymous 2013-02-10 23:16

I'll add a to MIT and lunch with The Sussman The Abelson to whoever wins first prize.

Name: Anonymous 2013-02-10 23:19

I'll add a to MIT
* I'll add a trip to MIT

Name: Anonymous 2013-02-10 23:27

I know what you're doing, you're planning on using the program to win the brainfuck challenge so you can find out the secret to multiquotation.

Name: Anonymous 2013-02-11 0:02

2013.28.02
The 2nd of icosikaioctober?

Name: Anonymous 2013-02-11 1:21

>>9
F
u
c
k

y
o
u

I

l
e
l'd

Name: Anonymous 2013-02-11 2:03

#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(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: 12 2013-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;
}

Name: Anonymous 2013-02-11 2:41

>>10
I'm leling so hard right now.

Name: Anonymous 2013-02-11 4:16

>>14
why do you lel anon-kun?

Name: Anonymous 2013-02-11 4:17

>>15
I found >>10's witticism to be quite lelworthy.

Name: Anonymous 2013-02-11 5:49

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: Anonymous 2013-02-11 10:40

What's a BTC?

Name: Anonymous 2013-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: Anonymous 2013-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: Anonymous 2013-02-11 13:06

I wrote GCC so someone could make a better compiler. Does that count?

Name: Anonymous 2013-02-11 15:04

>>21
Why write a compiler in C? That's stupid.

Name: Anonymous 2013-02-11 15:06

What sort of stupid challenge is this? This requirement is as vacuous as what my managers ask me to do.

Name: Anonymous 2013-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: Anonymous 2013-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: Anonymous 2013-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

Name: Anonymous 2013-02-11 17:31

>>26
puts

le e/b/in low level code bro xDDD

Name: Anonymous 2013-02-11 17:46

>>27
Please take your pills and get better soon, lel.

Name: Anonymous 2013-02-11 18:13

>>28
POOP

Name: Anonymous 2013-02-11 18:54

>>18
Basically the same as a BBC but a lot smaller.

Name: Anonymous 2013-02-11 21:06

>>12,13
You have been disqualified for the following reason(s):
     Too many dicks.

>>26
You have been disqualified for the following reason(s):
     Does not perform a function, does not check if the input is LISP.

Name: Anonymous 2013-02-11 21:09

>>31

code = raw_input('Please paste the source code here:')
if '(((((((((((((((((((((()))))))))))))))))))))))))))))' in code:
    print 'good goy'
else:
    print 'rewrite it in LISP'

Name: Anonymous 2013-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.

Name: Anonymous 2013-02-11 21:24

>>33
Fuck you fagstorm.

Name: >>34 2013-02-11 21:59

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?

Tell me I'm not alone.

Name: Anonymous 2013-02-11 22:00

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.

Name: Anonymous 2013-02-11 22:24

>>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.

Try reading SICP HtDP again.

Name: Anonymous 2013-02-11 22:25

Pretty interesting, >>37

Name: Anonymous 2013-02-11 22:42

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 =)

Name: Anonymous 2013-02-11 22:42

Pretty interesting, >>39

Name: Anonymous 2013-02-11 22:45

btw what's 15 bitcoin worth ?

Name: Anonymous 2013-02-11 22:46

Pretty interesting, >>41

Name: Lambda Arthur Calculus 2013-02-11 22:46

>>31
Does not perform a function
What about main, puts, and sleep (whatever that is)? They're functions.

does not check if the input is LISP.
Doesn't need to. Passing in a lisp program has UNDEFINED BEHAVIOUR! YAIN'T RED DA STANDARD.

Name: Anonymous 2013-02-11 22:48

>>41
Don't worry about it; if you manage to solve this, then you'll never worry about money again.

Name: Anonymous 2013-02-11 22:52

>>44 except the nsa would probably have stolen it before i managed to afford a patent =/

Name: Anonymous 2013-02-11 23:09

lets face it, there ain't no money in stopping terrorists.. stealing tech though, ka-ching ka-ching ka-ching .....
good ol' national security eh?

Name: Anonymous 2013-02-12 3:21

3-axis rotation ^^



vdub = [1,1,20,20,5; 2,2,19,19,0];

locA = [-1, -10, 10];

locB = [10, 10, 5];

AtoB = locB .- locA;

BtoA = -AtoB;

for (iter = 1:size(vdub,1))

  shnd = vdub(iter,:);

  flatmat(shnd(1):shnd(3), shnd(2):shnd(4)) = shnd(5);

  endfor;

pointmat = [];

for (iterx = 1:size(flatmat,1))

  for (itery = 1:size(flatmat,2))

    for (iterz = 1:flatmat(iterx, itery))

      pointmat(end+1,:) = [iterx, itery, iterz];

      endfor;

    endfor;
 
  endfor;

%%pointmat(:,1) = pointmat(:,1) .- locA(1);

%%pointmat(:,2) = pointmat(:,2) .- locA(2);

%%pointmat(:,3) = pointmat(:,3) .- locA(3);

pointmat = microShift(pointmat, locA);

figure(1);

hold off;

plot(pointmat(:,1) ./ pointmat(:,2), pointmat(:,3) ./ pointmat(:,2), 'r+');

hold on;

plot([-1,1],[1,-1], 'w.');

stepAng = pi / 180 * 5;

rox = [1, 0, 0; 0, cos(stepAng), sin(stepAng); 0, -sin(stepAng), cos(stepAng)];

roy = [cos(-stepAng), sin(-stepAng), 0; -sin(-stepAng), cos(-stepAng), 0; 0, 0, 1];

roz = [cos(stepAng), 0, sin(stepAng); 0, 1, 0; -sin(stepAng), 0, cos(stepAng)];

cswap = {'r+', 'g+', 'b+'}

for(iter = 1:150)

  figure(2);

  pointmat = microShift(pointmat, AtoB);

  pointmat = pointmat * rox';

  pointmat = pointmat * roy';

  pointmat = pointmat * roz';

  pointmat = microShift(pointmat, BtoA);
 
  hold off;

  frmat = pointmat;

  plot(frmat(:,1) ./ frmat(:,2), frmat(:,3) ./ frmat(:,2), cswap{mod(iter,3)+1});

  hold on;

  plot([-3,3],[3,-3], 'w.');

  usleep(5000);

  endfor;

Don't change these.
Name: Email:
Entire Thread Thread List