Hacker News new | past | comments | ask | show | jobs | submit login
Core War (wikipedia.org)
236 points by optimalsolver on Feb 11, 2022 | hide | past | favorite | 50 comments



This Jeff Atwood article (via the links below) is nice: https://blog.codinghorror.com/core-war-two-programs-enter-on...

The original Scientific American articles which introduced Core War are at http://www.koth.org/info/akdewdney/ (via https://news.ycombinator.com/item?id=12566384, but no comments there). Scans of those articles (via Atwood) can be viewed here: http://www.corewars.org/sciam/

Only a few past discussion:

The Core War Game Implemented in C - https://news.ycombinator.com/item?id=14442325 - May 2017 (1 comment)

The Halloween Core War Tournament - https://news.ycombinator.com/item?id=8505573 - Oct 2014 (1 comment)

Core War Tournament – Spring 2014 - https://news.ycombinator.com/item?id=7804141 - May 2014 (11 comments)

Two Programs Enter, One Program Leaves - https://news.ycombinator.com/item?id=2462535 - April 2011 (37 comments)

Core War: Two Programs Enter, One Program Leaves - https://news.ycombinator.com/item?id=153505 - April 2008 (8 comments)


I love (and loved) Core War.

I was maybe 12 or 13 in the late 80s, born and living in a tiny town in central Italy (Assisi), in love with technology and programming, also thanks to an older brother and his Commodore64.

One of his friend, ~10 years older than me, was studying CS in Pisa (one of the best CS universities in Europe, at least back then), but was frequently back home, and I used to visit him and play some videogames with him on his 386 or 486.

At some point he introduced me to Core War. I was instantly hooked, and we started writing "viruses" (that's how we called the programs) and then run tournament to see which one would perform best. I loved programming these things, and the intellectual challenge associated with it.

I am forever thankful to the creators of Core War. I ended up studying CS, moving abroad to work at AWS as a Technology Evangelist (first employee in Europe, back in 2008), and eventually having a rather successful career in IT. Core War deserves part of the gratefulness for all I had in life. BTW, this is the story of how I found my job at Amazon [0].

[0]: https://simon.medium.com/2008-how-i-got-hired-by-amazon-com-...


Koth is still running for those who want to try - http://www.koth.org/lcgi-bin/current.pl?hill94 shows "Last battle concluded at : Sun Feb 6 01:34:58 UTC 2022"

... Though that also suggests that it isn't run that often either.


It takes a lot of time to write a competitive warrior. I'm thrilled that people are still playing at all.


AFAIK it runs when you submit a warrior, Of course these days that's not super frequent, but it's not like you need to wait days after submitting a warrior either.


I remember reading about a version of this for the BBC Micro called RAM Wars which was published in Micro User in 1988. Tracked down details here: https://www.stardot.org.uk/forums/viewtopic.php?f=32&t=14334

It's basically the same game, including referring to Redcode and running it in MARS.

Apparently there was an earlier BBC port that seems closer to the original game in 1985, predating RAM Wars.


I have a copy of that issue of Micro User gathering dust somewhere! But I remembered that they called it "redcode"


What are some ways to make Core War a deeper game? Like to reward more complex warriors, and move away from the rock-paper-scissors equilibria. Sort of like how there's that Wikipedia compression contest that includes the compression algorithm's length in the score to prevent gaming it.


You can look at any RTS and come up with many ideas:

- More variety in memory layout (different topologies, hidden caves that can be entered only if you control a location, bots can influence the layout while in game...)

- Special instructions that grant special abilities like memory protection, but at a computational or memory cost

- More resource types (different executing CPUs with different strengths/weaknesses, different memory nodes harder/easier to access like a queue, extra hardware gadgets you can take over like TIS-1000 nodes)

- Game progression (research side quests to get additional special HW, at either one-time resource cost or via special task like guessing a password, deciding NP complete instance..)

- Additional game goal types (capture the flag, first to finish computing a neutral program wins)

Just a few. The game concept has a lot of potential.


first to compute a neutral program is a really neat idea. the more RTS-style ideas feel unnatural to bolt onto it, but the requirement to do something useful would be neat.

I can imagine strategies of stealing competing warriors' work or corrupting data.

I wonder if you could do like, ASLR core wars somehow.

also befunge wars would be fun but break me.


Screeps comes to mind: https://screeps.com/


I remember as a kid, being annoyed that you get penalised for replicating. This is different to nature, where replicating gives you more "processing power".

So I wrote a version where every thread was running at the same speed, but that was always dominated by very simple replicators.

Then I tried to figure out how to have an instruction set where all instructions run at the same time. But I could not come up with something that worked well.

Recently I wrote a "cellular automaton with provenance" thing. Basically game of life, but you track the originator of each cell. That is fun, but also does not lead to a good game as far as I can see.


> I remember as a kid, being annoyed that you get penalised for replicating. This is different to nature, where replicating gives you more "processing power".

Perhaps you can make your idea work with some more real world ideas?

In the real world, you need resources to do anything. You find resources in the environment. Be that water, food or sunlight etc.

In Core Wars processing power is a resource. In standard Core Wars, your side has a fixed supply of resources. Replicating just divides that fixed supply amongst more agents. Somewhat realistic.

You can steal other people's processing power, if you manage to make some of their threads execute your code. (In that weirder sense, replicating in Core Wars can give you more processing power.)

Your idea was to hand out the resource of processing power just in relation to how many times you replicated. You found that's not workable.

Perhaps you could come up with a way to make players earn processing power?


Because you are time-sharing, there is a strong disincentive to writing complex (long loop) programs. You have to scan for enemy programs, and throughput is important there. So unfortunately it doesn't get very deep.

I suppose you could make it more interesting by battling it out on real systems, a mix of Core War and CTF if you like.

Fortunately there are other programming games such as Robocode, Screeps, yare.io, etc.


> rock-paper-scissors equilibria

is only a crude approximation.



Core Wars was great!

I spent a good amount of time in the late 90s writing little bots for a similar game, AT-Robots, where you write an assembly type language to program a little laser-shooting robot that could drive around, scan for enemies, etc.

http://necrobones.com/atrobots/

And my best robot: http://necrobones.com/pub/atrobots/robots/unlocked/mj6.at2

Anyway, I loved this kind of thing as a teenager. I felt it really helped me to fall in love with programming and the ability to make things happen by writing code.


There was a fun PC game called Omega [1] where you earned resources to build a tank and then programmed it to win combat; which earned you more resources. It was a great game. It had it's own programming language, iirc.

[1] https://en.wikipedia.org/wiki/Omega_(video_game)


I have fond memories of this being the final challenge of Zebulun[0]. They took a top performing program and gave specific requirements, like creating a vampire pit to trap the other program.

[0]: https://www.ca-zeb.com/zebulun/


I remember having done a project like that in my CS school. We had to do a compiler from some pseudo asm to the binary opcode supported by the corewar VM, the corewar VM itself (you can call it the arena) and a champion and we would fight champions across teams. Taugh me a lot about opcodes and emulation.


Is there a resource available online? Would love to try implementing this.


This is the most complete description I found (I don't have my original one sorry), in french also http://oxyde.free.fr/projets/vm.html I can provide a list of champions source code (asm) that was provided to test all of that. Also found this project that looks quite complete https://github.com/ClementBolin/Corewar_Epitech


There's a Core War tournament in progress this week, being livestreamed on twitch https://twitch.tv/corewarglobal

Also, there are better quality scans of Dewdney's articles here https://corewar.co.uk/sciam/


I came across this game in the late 90s and the impression that I got at the time was that I had missed the boat and the game was essentially "solved" and the best programs were already known. Is this not the case?


It is highly optimized, so it is rare for a completely new strategy to emerge. But it also depends on the mix of other warriors, and you can create different types of environments and challenges.


It's definitely not solved yet. The various king of the hill servers are still ever changing. I figure it's a rock-paper-scissors type thing: there's no one ultimate best solution.

That said, the warriors have gotten crazy good so getting a spot in the top 10 is very hard.


Are there any write ups into the details of how, say, the contest winners work?

I remember having a few good afternoons of fun with Core War as a teenager back in the day (I probably found an implementation on a shareware/freeware CD). But while that made me understand the tradeoffs of some of the common strategies mentioned on this wiki page pretty well, getting into the (often entirely uncommented) complex red code of some of the winners wasn't something I was too keen on doing without at least some description.


Has anyone created some sort of Core War Zero?



Wasn't there variant of this Doug McIlroy won by getting core below attack limit?


Yes, that's Darwin from 1961 https://corewar.co.uk/darwin.htm


dewdney is a genious, loved reading "The Armchair Universe", " The New Turing Omnibus" while i was in high school, i still go back to re-read, to see his unique fun way of exposition on CS theory


Unfortunately corewar.io seems down. I'm not sure what happened to them.


works for me



Yes, it works.

However, the site is .. odd. I'm not sure what triggers it, but if I visit the page from a link on the site, it works, but if I visit that link from your link, it doesn't. Except now, now they both work. Some odd caching artifact? Not sure.


I found that clicking the "play" link at the top made a difference? Pretty weird.


---------------

Page Not Found

Looks like you've followed a broken link or entered a URL that doesn't exist on this site.

Back to our site

If this is your site, and you weren't expecting a 404 for this path, please visit Netlify's "page not found" support guide for troubleshooting tips.


Sounds like someone's doing something with the Referer header.


Yeah sometimes I get through. Try refreshing


Can we consider it a precursor to crowdsourced code competitions? Like the Netflix recommendations contest and Kaggle.

Are there any modern equivalents, where people submit code to be run against other submissions?


Every now and then there is one at codegolf.SE's king-of-the-hill tag



Is there implementation that is actively maintained?

CoreWar looks like my ideal programming game. Now I'm playing Zachtronic games (TIS100, Shenzen I/O) and occasionally Robocode.


https://github.com/akosela/pmars appears to be one of the more recently built ones.

It's a pretty much "finished" application.


My FIL told me about this at thanksgiving! Said he had a lot of fun with them back in college


Sounds like it would fit right in at a King of the Hill CTF challenge.


I remember having to order a copy of the SA article for a small amount of $ (which I didn't have, but didn't not have, kids didn't have money) and a week wait at school from the state library.

Different world...

(And the hysteria in the 80s/early 90s was this was training for computer virus writers ;) but people also thought computer crime was fun so it wasn't like D&D style hysteria)


The first question on my mind : is it feasible to translate redcode to regular assembly?

Take last year's winners. Translate. Profit.


What do you mean, "profit" how? Regular assembly works in a very different environment, and the code is much less constrained (and more low level). Even if your goal is to just crash/overwrite some other code in the same address space, you don't really need to employ any of the core war strategies, and the code you target also won't "fight back".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: