Core War: Two Programs Enter, One Program Leaves

Oddly enough, I was just thinking about those old Scientific American articles. I started reading some of them in 1987 to 1988 time-frame. At that time I had a Commodore C128 and it really was fun to read the articles. Oh the memories!!

I wonder how many virus/worm/trojan programmers cut their teeth reading these articles.

*Snathi, Windows didn’t exist when this codewar was written about. So this is not the codewar you’re thinking of…and these are not the driods you are looking for.

Some comments from a reddit post that I thought deserved to be echoed here:

http://reddit.com/r/programming/info/6eb2g/comments/

  • there’s no mention of redcode’s rich addressing modes (8 in the last revision)
  • there are two variants with different opcode sets, redcode’88 (ICWS-88) and ICWS-94; the latter adds multi-processing and state saved across runs (so the warrior can choose the best strategy based on previous outcomes)
  • there are several hills with different opcode sets and core sizes. AFAIK the most popular ones are hosted at koth.org.
  • the three basic strategies he lists (paper, stone, scissors) are not the only fundamental ones; you could add at least imp(-spiral)s, and vampires which trick the opponent’s process(es) into executing your code
  • you can see the evolution of the state of the art in the Core Warrior newsletter (http://corewar.co.uk/cw/)

This is incredible. Thanks for exposing me to it.

Whats with the green and black layout. I thought that was an April’s Fools joke but it is still there. It is so hard to read, not to mention that it is annoying. You more than others should understand human factor and UI conventions. And the convention is that people are used to read black on white. Could you please provide an alternative style at least.

My bad. It was simply cached in the browser.

Hey, I sent your article to my Digital Logic teacher, it seems he will a CoreWar with FPGA, we will build a processor implement it in a FPGA and then play CoreWar in it. Very cool, thanks Jeff.

I’m loving this idea - I haven’t tried it out yet but I’ve downloaded it for when I have a spare hour or so… I’ve tried many “bot battle” things in the past seeking programming “victory”, but they’ve never been that satisfying. I get the feeling this will be a little different!

Thanks for the suggestion Jeff!

I remember I read a book a long time ago. The author (I don’t remember his name) gave Dewdney the “honour” of invent the computer viruses. He said that some time after the Core War game was introduced, the first actual viruses came out. I don’t know if it’s historically exact.

Rich Skrenta may have invented the computer virus with “Elk Cloner” in 1982; that predates Core War

http://en.wikipedia.org/wiki/Elk_Cloner

Hehe, remembers me the time back 1993 when I wrote a core war simulator with my cousin in Turbo Pascal. But writing the simulator was much more exciting than writing red code programs.

Sorry about that, Corewar folk are getting lazy when it comes to preparing newsletters :frowning:

There’s also a newsletter specific to the nano hill:

http://corewar.co.uk/nw02.txt

Ah, corewars is very cool. I always was too dumb to develop my own warrior, so I wrote a program that uses genetic programming to create warriors automatically. Thats easier :slight_smile:
http://corewar.co.uk/ankerl/yace.htm

One year, Core War was a problem on the ACM programming team competition. Our team opted not to attempt it, but it looked cool.

Looks tasty, although I’d probably add the carrots a good fifteen minutes before the cabbage.

J.Stoever: “I vaguely remember playing that when the apparent killer app (won like 95% of the battles for me) was a simple “MOV current current+1”. It would just copy this single instruction into the next memory slot, which it then would move on to, only to repeat, etc. How did they fix that ?”

That’s the Imp. I find it hard to believe that it won 95% of the battles for you; most of the time it will result in a tie, since the opposing program gets “converted” into an Imp as well, and as soon as control gets transferred, it will do exactly the same thing your Imp just did. You need DATs to guarantee a win.

David: Imps may be hard to hunt, but they are VERY easy to trap, and a trap is also only 1 instruction. Your explanation isn’t right either; not only does an imp not replicate itself on every instruction, it doesn’t replicate itself at all (it just moves around). Replicating, in the sense of having an “extra life” if you execute an illegal instruction, requires an SPL. A nave imp never does this, so as soon as it hits a gate, the entire program is dead because it only has one process.

Maybe a long time ago those things could win or tie, but they’re not very effective now unless you use a few different kinds and spawn a whole bunch of them (which of course takes away from the simplicity and tiny size).

It’s really not so simple. If it were, they would have declared the competition over a long time ago.

Code/Programs that learn? Sounds like Skynet.

It became self aware on August 29 , 1997…

I’ve heard about core wars before, but this post did inspire me to look it up again. While I’ve always thought the idea core wars was pretty cool, I’ve clicked through the links and the scene looks pretty moribund. For example, the last installment in the core wars newsletter was in May 2007. A pity. But understandable, given this is a game that’s been going on since 1984 or so.

Some idiot forgot to upgrade the GLIB and GTK+ dependencies for Linux.

vim configure, here I come…

You can try out Code of Tanks, a 3-D tank battle game, which is brand new as of this writing. You write your AI in a .NET language, C# or whatever. Whenever you want to play you create or join a room, run your AI and pick your tanks, and watch the battle live in 3-D. You can watch the video trailer at the website to see it in action: http://codeoftanks.com