Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 3
There are 1 users currently browsing forums.
Reply
  #1  
Old 01-02-2007
College Student
 
Join Date: Jan 2007
Posts: 210
Rep Power: 4
Mgccl is on a distinguished road
COTW #6 Entries

seems like no one have posted for any code contest...
so I come here to post one if you guys don't mind....
This time, the code contest will be

a polymorphic self-reproduce code generator that generate offspring codes have the identical function(which is a
polymorphic self-reproduce code generator that generate offspring codes have the identical function, which is... yeah... this is never ending...)

This means, you have to create a code that will create a copy of itself, then change part of the new copy, and make the new code can do the exact same thing as the old code...

You goal will be making your code still works after the 10th variation. and
impossible to see resemblance(if any)to the original code with a professional coder eyes.

wish you guys best luck
__________________
Reply With Quote
  #2  
Old 01-02-2007
unclekyky's Avatar
Jovially Avuncular
 
Join Date: Sep 2004
Age: 20
Posts: 5,889
Rep Power: 11
unclekyky is on a distinguished road
Re: COTW #6 Entries

IMO this is way out to the scope of a COTW contest. However, I will enter I can't wait to see your guys' code.

EDIT: Come to think of it, I am not sure what this is all about. We have to create a program that replicates itself. It needs to have the exact same functionality, yet look completely different? This is very vague. How can two programs (in the same language) have the exact same functionality without looking similar. I mean, if the functionality of my program is to print "Hello, world!" then it is going to look similar in any fashion.

I will still give it a shot, but some more clarification would be great. Like what do you mean by functionality. Is the functionality the output? Or would a+b (without printing the result) be part of the functionality?
__________________
Spore-Game - The Ultimate Spore Fan-Site
Abnegating Avunculicide Since 1601 | YC Wiki - "Quidquid latine dictum sit, altum sonatur."

Last edited by unclekyky; 01-02-2007 at 03:59 PM.
Reply With Quote
  #3  
Old 01-05-2007
College Student
 
Join Date: Jan 2007
Posts: 210
Rep Power: 4
Mgccl is on a distinguished road
Re: COTW #6 Entries

well.. I think I should make this easier.. because there is no point for it to morph 10 times.

this is actually like make a script that:
replicate self:
easy, read self(for script languages), or read the predefined string that store the source code(for non-script languages) and save as another copy somewhere in the hard disk
Manipulate replicated self:
make it unreadable but it still work like the original...
to do that, you just have to trash your code, sugar coat, encrypt, encode or anything possible to let it can't be easily understand...
here is my version... the most basic version because I have to tell you guys I don't know regex, which made this thing pretty hard.
if I do know regex, I can do a lot more operations... like trashing... but now I can only make variables harder to read >.< but this have done what is required... each copy of the script that generated can be used to regenerate a another copy that does the same thing but looks different.
I might update my version soon... doing some regex crash course...
I name this script... PHP Bacillus sphaericus... one of the oldest bacteria... >.<
PHP Code:
<?
$fp 
fopen(__FILE__'rb');
$script fread($fpfilesize(__FILE__));
$script str_replace('$fp''$V'.md5('$fp'),$script);
$script str_replace('$script''$V'.md5('$script'),$script);
$fp fopen(md5($script).'.php''wb');
fwrite($fp$script);
echo 
'replicated';
?>
__________________
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COTW #5 Entries gorda001 Code Of The Week 6 10-22-2006 11:18 AM
COTW #3 Entries gorda001 Code Of The Week 31 09-30-2006 11:47 AM
65k entries and generating under-pages. angelo.cpp PHP Scripting 1 08-27-2006 02:35 PM