- Core War
Paper covers the stone, scissors cut the paper, stone grinds the scissors.”
von Neumann, John and Oskar Morgenstern Theory of Games and Economic Behavior 1953.
A variety of strategies have evolved for Core War, each with their own strengths and weaknesses. Warriors often incorporate up to three distinct stages — an opening strategy, a midgame strategy and an endgame strategy.
An opening strategy is used by some warriors to gain an advantage during the first few cycles before moving on to the midgame. The code for the opening strategy is normally run once and then discarded:
- A quickscan uses an unrolled loop to scan as fast as possible in an attempt to find and attack the opponent before it has finished setting up.
- A booted warrior copies one or more of its components away from their original location leaving behind a decoy to distract scanners and quickscans.
- Decoy Maker
- A decoy maker uses an unrolled loop to rapidly build a decoy of incremented / decremented locations to distract scanners and quickscans.
- A p-switcher selects between a number of different midgame strategies according to the results of one or more previous rounds.
- A handshaker detects when it's fighting itself and causes one copy to suicide. This leaves the other copy with 100% wins and artificially inflates its score.
A warrior is defined by its midgame — either a basic strategy or a hybrid combining two or more components. Three of the most common strategies are named after the moves in the game paper-scissors-stone:
- A paper spawns multiple copies of itself and executes them in parallel. Paper is normally small and resilient, performing well against stones and losing to scissors.
- Scissors scan for the opponent and hit hard, first stunning with a
SPLattack then switching to a deadly
DATattack. Scissors are often large, scoring well against paper but losing to stones.
- A stone blindly scatters simple
DATbombs through memory in the hope of hitting an opponent. Stones are usually small and fast, performing well against scissors and losing to paper.
- Vampires attempt to capture enemy processes by placing a
JMPinside the opponent's code. Vampires are often complex, scoring well against scissors, average against paper and losing to stones.
- An imp moves through memory by copying itself just ahead of the instruction pointer. Modern imps run at multiple points in memory and are seldom seen alone, usually paired with paper or stone.
- A bomber randomly drops complex bombs designed to damage or stun the opponent. They tend to score well against scissors, lose to stones and are sometimes capable of beating paper.
- An imp spiral is often paired with a stone to reduce some of the losses against paper. Some of the most successful warriors of all time are stone/imps.
- A paper/imp combines two tie prone strategies to create a defensive warrior which can be tricky to beat. They tend to score too many ties and not enough wins.
- A paper/stone usually pairs an aggressive paper with a stone to improve the performance against other papers and stone/imps.
- One of the most complex strategies is the vampire/imp which adds an imp spiral to convert some of the vampire's losses into ties. Vampire/imps are rarely seen on the hill.
- An imp spiral is often added to a core-clear to create a warrior that performs well against stone/imps.
Some warriors are only designed to damage or stun the opponent during the midgame then switch to an endgame strategy to finish the opponent off:
DATbombs. Some clears also have a
SPLwipe to stun the opponent. Clears are often used by scanners and bombers to wipe memory at the end of the game.