Path: ibmpcug!wendy.ibmpcug.co.uk!pipex!howland.reston.ans.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811s From: pk6811s@acad.drake.edu Newsgroups: rec.games.corewar Subject: Re: Self fixing code? Date: 25 Apr 95 15:03:22 CST Organization: Drake University, Des Moines, Iowa Lines: 206 Distribution: world Message-ID: <1995Apr25.150322@acad.drake.edu> References: <3niub0$l3g@idefix.eunet.fi> NNTP-Posting-Host: acad.drake.edu In article <..> Tom Eklof writes: > > Is it possible to make a program that fixes itself? If it is, could > someone give me the piece of redcode (preferably ICWS'88) so I > could check it out. No, I'm not going to use that piece of information > on a hill etc... I won't even enter a tournament yet, I'm a lousy > programmer =) > There's the Five Musketeers, I don't seem to have a copy, it works by putting five copies of the program equally spaced in core. Each copy is responsible for checking a flag in one other copy to see that that copy is still running. If not it rewrites and restarts it. I have one that works as a pair of copies. Each copy continually scans the other for differences in its code as compared to a non-running dummy copy. It has the ability to backtrack vampire fangs and kill the pit as well. Here's the code: ;author P. Kline ;strategy Mutual-repairing pair. spacing equ 4000 start mov start-2,datzero mov #endme-brother+1+spacing,brother mov #enddum-dummy+1,dummy mov #enddum-alive+1+spacing,alive mov #endme-meptr,meptr copy1 mov @meptr,-20 loop jmp chk,{fix kill mov d4,{fix spl rset,1000 fix mov