last day (15 days later) » 

6:45 PM
0
Q: Self-Mutilating Program

mbomb007Simply put, your goal is to create a complete program that modifies its own source code until every character of the source is different than what it started as. Please include the beginning source as well as the ending source in your post, as well as a description. E.g. Describe what (else) you...

 
@Zgarb It must actually modify its own, currently running source code. Yes, that rules out most languages.
 
@mbomb007 That's bad.
 
@minxomat Why? If a program can edit its file and re-run it, it makes the challenge kind of trivial.
 
@mbomb007 It's says nowhere in you challenge that it has to rerun the output (i.e. run any modification at all).
 
@minxomat Your program's goal isn't to output anything. It's to modify itself.
 
6:45 PM
Also, no it doesn't make this challenge trivial, it'll still good scoped. You ruled out too many languages with this.
 
So you want me to allow you to break rule #2, then just add a penalty for doing so?
like +50%?
 
What? No. You challenge has a logic error to it.
 
Nope
Your program simply modifies itself and halts. There's no output
 
Yes. Nothing can modify it's currently running source code, since the source is already parsed (no matter if it's interpreted or not).
I know there is no output.
 
Self-modifying BF, Redcode, ...
Smith#
there's 3 usable languages
quit whining and do some research
 
6:48 PM
> Self-modifying Brainfuck is a variant of brainfuck by Simon Howard, which allows a program to modify its own source code. The program code is placed in the data array, and the data pointer starts at the byte immediately after the last instruction in the code.
So it generates a completely new program and moves to pointer.
Old source is discarded, not modified.
If you run SMBF program a it will lay out the memory like ab (where b is the modified source) and eval b. a is still there.
It's the same principle as if you modify the source code "file" in any other language and call the compiler/interpreter again.
 
7:17 PM
"Real self-modifying languages should have an advantage." Only allowing languages XYZ is fine, but I see no reason to arbitrarily disadvantage some of the languages you allow. In any actually self-modifying language, that approach is going to be a lot longer. In other languages, it's the only approach, so the penalty doesn't make sense. Plus, they're not even the same challenge... Just get rid of that whole clause, IMO.
Nobody wants to write a 1000-byte C program that "loses" to the 1-byte REDCODE solution that you posted yourself and gets a 20% shame penalty despite taking ten times the effort.
 
@mbomb007 Function/script can be considered it's own program? (LISP function that redefines itself when called)
 
 
2 hours later…
9:02 PM
@Mauris It's not even competing...
@JonathanLeech-Pepin Go ahead and post it if you want. Someone else posted a similar function.
 

last day (15 days later) »