General Notes

Coding Horrow: Two Programs Enter, One Program Leaves


Core War has four main components: a memory array of 8,000 addresses, the assembly language Redcode, an executive program called MARS (an acronym for Memory Array Redcode Simulator) and the set of contending battle programs. Two battle programs are entered into the memory array at randomly chosen positions; neither program knows where the other one is. MARS executes the programs in a simple version of time-sharing, a technique for allocation the resources of a computer among numerous users. The two programs take turns: a single instruction of the first program is executed, then a single instruction of the second, and so on.


What a battle program does during the execution cycles allotted to it is entirely up to the programmer. The aim, of course, is to destroy the other program by ruining its instructions. A defensive strategy is also possible: a program might undertake to repair any damage it has received or to move out of the way when it comes under attack. The battle ends when MARS comes to an instruction in one of the programs that cannot be executed. The program with the faulty instruction -- which presumably is a casualty of war -- is declared the loser.


I read the above a while back (and heard of CoreWars years ago), but didn’t realize it was still active*:


* yes, the article says “Core War, surprisingly, is still around” but it didn’t sink into my consciousness.


See Also



Category tags

Programming recreation assembly language



No comments yet.



Add Comment

 Your Message
 Enter value ← Have you entered the code number?