Showing posts with label corewar. Show all posts
Showing posts with label corewar. Show all posts

Wednesday, 8 July 2009

Maezumo: The Corewar Evolver with a Twist

Maezumo, Fizmo's Corewar Evolver2009 looks set to be the year of the evolver with 5 new evolvers to date. The latest offering is Christian 'Fizmo' Schmidt's Maezumo, the Corewar Evolver with a Twist.

After extracting the archive and changing the settings in maezumo.ini for nano I fired up Maezumo. The evolver produces a table of results in index.htm which refreshes every few minutes.

For the first 93 steps simple coreclears ruled the day. Warrior 93 was a simple paper and over the next 20 or so steps papers managed to take complete control. By step 130 most of the papers had disappeared to reappear again at step 174.

At this point I noticed a potential problem. Whether through my error or a bug in the program, the last line of every warrior is always dat.f $0, $0. So far I haven't figured how to fix this.

My first impressions of Maezumo are that it's effective, maintains diversity in the pool and the reports look fantastic. For a future version it would be nice to see more statistics in the reports, e.g. lineage.

Monday, 6 July 2009

A New Arms Race, the Tiny Evolvers

A new Corewar arms race is in progress, the battle to create the smallest effective Corewar evolver. There are currently two contenders:
  • Terry Newton: Terry is the evolver guru having previously written three evolvers, Fizzle, REBS and Redmaker. Terry has three new tiny evolvers, JB, SEWAX and LCE. At least two of these have produced nano warriors that entered the hill.
  • John Metcalf: John is a hand-coder who recently got tempted by the dark side of Corewar! John has published two versions of his tiny Corewar evolver, TEV. Both TEV0 and TEV12 have created warriors which entered the nano hill.
Right now, I'm wondering if anyone will break the 1K barrier and if so, who :)

Sunday, 1 March 2009

Redcode Forth

redcode forth interpreterRedcode Forth is an interpreter for a 36 word subset of the Forth programming language. I don't know much about Forth, but fortunately the interpreter is supplied with a summary of the instruction set and a step-by-step example.

The interpreter uses a new Redcode instruction to display text, sts. I wonder if John is also planning to support ARES which has a different system for i/o?

Friday, 16 January 2009

The DynaHill at Corewar.Info

the Corewar DynaHill at Corewar.InfoTowards the end of last week, Christian Schmidt announced a new Corewar hill, hosted at corewar.info. The Corewar DynaHill is build around a different concept to KOTH and SAL.

The battles are scheduled at regular intervals, regardless of the number of submissions. When battle takes place, the warriors fight their neighbours and  move up or down the ranks depending on the number of wins or losses.

The hill is unlimited in size. LP and '94 Standard warriors can be submitted to the same hill. The battle settings are decided from the warriors' ;redcode declarations.

Apparently, the system is similar to the rankings used in Japanese Sumo. To find out more, visit the DynaHill FAQ.

Monday, 8 December 2008

Corewar: Hostile Programming

Corewar is a game from the 1980's, played between computer programs written in Redcode, a language similar to assembly. The programmers design their battle programs to remove opponents from the memory of the MARS virtual computer by any means possible.

Some of the simpler techniques include blindly overwriting memory, searching for the opponent or spawning off new processes. These are commonly known as stone, scissors, paper after the popular playground game. Stone usually wins against scissors, scissors normally defeat paper, and paper mostly beats stone.

Here's an example of a typical Corewar program:

     org   wipe

step equ 5
first equ bomb-10

bomb:mov.i #1, -1

ptr: sub #step, #first
wipe:jmz.f ptr, @ptr

mov bomb, >ptr
djn.f wipe, {ptr-5

end

This simple example of scissors once held a 20 point lead over it's rivals. The first instruction is never executed, it's the bomb used to overwrite opponents. The next two instructions form a loop which looks through memory for an opponent, and the final two instructions actually overwrite it.

Corewar is still going strong, and celebrates it's 25th anniversary in 2009. If you'd like to discover more about Corewar, here are the top resources:

What are your experiences with Corewar, have you ever had any success?


John Metcalf

Corewar: Hostile Programming is a guest post written by John Metcalf.

Wednesday, 19 November 2008

nanoWarrior #03

nanoWarrior - incredibly small corewarThe latest issue of nanoWarrior has finally been completed, containing articles by John Metcalf, German Labarga and me. Check it out for yourself here:

Wednesday, 12 November 2008

Neo's Mini Challenge - Roy's Idea

Roy suggested a tricky extension to Neo's Mini Challenge in rec.games.corewar:
Lets try to find a solution for this gate:
djn.f #0,>-5
(I haven't got one yet)
It appears a one instruction solution isn't possible. However, 5 players found a solution in two instructions.  Congratulations to Ilmari, John, Rashnok, Roy and me! Also, well done to German and Lukasz who also discovered solutions, albeit slightly longer.

I discovered a five line imp:
imp mov.i #4,   *1
mov.i #4, *1
mov.i #4, *1
mov.i #4, *1
mov.i #4, *1
By adding a loop, I managed to reduce the initial size to two instructions:
imp mov.i #4,   *1
djn.a imp, #0
John and Rashnok discovered the same 3 line imp and used a loop to reduce the size. Ilmari discovered a 2 line imp. Roy wrote a program to find 58 solutions by brute force!

Full details are on Neo's page for the Harmless Overrun Mini Challenge.

Sunday, 9 November 2008

Thoughts on Corewar...

Thoughts on Corewar...
Thoughts on Corewar is John Metcalf's Redcode programming blog, hosted at http://impomatic.blogspot.com. Since John's blog was last reviewed, both the name and design have changed.

The standard template has gone and the sidebar now contains a selection of useful rss feeds, including the latest posts from rec.games.corewar and the most recent additions to the infinite nano and tiny hills.

The most interesting recent posts have been about Semaphores in Redcode, which provide a means of implementing mutual exclusing in Corewar.

What I liked:
  • Covers advanced programming topics
  • The feeds make it easy to keep up-to-date
Room for improvement:
  • More comments on the code would be handy

Friday, 31 October 2008

tiny Twilight

Here's the code for Twilight, my most successful tiny warrior so far. When this entered SAL's tiny hill in 24th place two years ago, I didn't expect it to last long!

I'm surprised to see it's still on the tiny hill age 79. Currently it's in 10th place, the best position to date :)

;redcode-tiny
;name Twilight
;author S.Fernandes
;strategy oneshot v1

;assert CORESIZE == 800

; entered the hill on 12 Mar 2006 in 24th place
; still on the hill on 31 Oct 2008, age 79, 10th place

org scan
step equ 24
gap equ 6
first equ loop+step*5

ptr dat first+gap-1 , first-1

dat 0 , 0

x dat 1 , 9
clr spl #350 , 12
mov *x , >ptr
mov *x , >ptr
djn.f clr+1 , }clr

for 2
dat 0 , 0
rof

loop add inc , ptr
scan sne *ptr , @ptr
djn.f loop , *ptr
djn.f clr , ptr
inc dat step , step
end

Wednesday, 22 October 2008

Neo's Mini Challenge - The Results

Neo's Mini Challenge is over and the results are in. Seven players entered, 6 of who discovered an optimal solution - 1 line, 1 process, 100% ties.

Neo and I entered the following code:
mov }0, }1

Ilmari and John entered this:
mov.i #1, *1

While Roy and Rashnok used a variation on the above:
mov.i #1, }1

Finally, mjp entered code which expands to a 6 line imp:
mov 2, @1
djn -1, #6
mov 0, >6

Roy suggested an interesting alternative which Neo will hopefully adopt as the next challenge.

Sunday, 19 October 2008

Neo's Mini Challenge

After a break of four years, Neo has relaunched the Mini Challenges, starting with Harmless Overrun.  To take part, you need to write an imp capable of passing through an imp gate:
gate: jmp 0,<-5
end gate

The aim is to tie 100% of the time with the shortest possible code. Good luck to everyone taking part.

Saturday, 12 July 2008

Miz's Corewar Page

A few days ago Mizcu moved his webpage to http://users.evtek.fi/~mikaos/corewar/, so now seems like an ideal opportunity to take a closer look.

The highlight of Mizcu's site is Monowire's story, the tale of a beginner's warrior.  Mizcu details the development of his oneshot from a beginner warrior to king of the KOTH.org '94nop hill.

Also in the Redcode section, Mizcu publishes some of his Corewar projects, including a generic table scan, Stoney the second and Lady Imperactive. Huffpaper includes an interesting variation to the standard silk concept.

Finally, there's an article about decoys which Mizcu is working on.  This covers the basics, active decoys, invisibility and will eventually include decoy makers.

What I liked:
  • Monowire's story
Room for improvement:
  • A few comments would make the code easier to understand

Wednesday, 2 July 2008

Will Varfar's Corewar Page

Will Varfar has a webpage devoted to Corewar at http://redcoder.sourceforge.net and shares some of his experiences implementing and testing Redcode simulators and evolvers.

Will's Which MARS report gives a thorough examination of different simulators, including some observations on their inner workings. The report concentrates on 6 open source MARS. It would be interesting to see the closed source simulators included in the comparison.

Species is Will's Redcode evolver, which attempts to improve on past evolvers with the introduction of species and chromosomes. Source code and a Windows .exe are available to download.

Some interesting statistics are published on Will's page. Will has gathered data about the frequency of opcode execution during a round robin of over 400k battles. Taking this one step further, graphs have been generated showing how the opcode frequency changes during a battle.

This data has been used to automatically divide the warriors into groups based on their execution fingerprint. It might be interesting to compare the results to those of Joonas's self organising maps.

Finally, there are a couple of article in which Will discusses the development of his entries for Neo's Mini Challenge #3 and Redcoder's Frenzy round 9.

What I liked:
  • In my opinion, Will has the most visually attractive Corewar site
  • 100% original content
Room for improvement:

Thursday, 26 June 2008

Welcome sh0newars


A few days ago N. Ristic aka sh0ne joined the Corewar enthusiasts in the #corewars IRC channel and not only started learning the ropes, but created a website which will hopefully document his rise to Corewar fame.  sh0ne's page is at http://sites.google.com/site/sh0newars and is definitely worth keeping an eye on over the next few weeks.

Tuesday, 17 June 2008

Łukasz Grabuń's Book of Stones

Łukasz Grabuń has a small Corewar site at http://grabun.com/corewar.  Apart from a selection of useful links, Łukasz's site contains the Book of Stones which he describes as "a modest continuation to the second chapter of Steven Morell's book".

The first chapter has an analysis of Carbonite by Ian Sutton.  After describing Carbonite's bombing run and the switch to a clear, the interaction with an opponent D-Clear is examined in detail. Unfortunately, the advantage of the remote bomb and using add.ab {0,}0 in preference to add.ab -1,-1 are not mentioned.

Behemot by Michal Janeczek is discussed in the second (and final) chapter.  The article begins by introducing the airBag and incendiary bomb techniques before moving on to Behemot's inner workings and interaction with dat bombers.

What I liked:
  • The Book of Stones
Room for improvement:
  • The chapter about Carbonite doesn't mention a couple of important points

Thursday, 12 June 2008

Tales from the Digital Wilderness


Tales from the Digital Wilderness is John Metcalf's Redcode programming blog, hosted at http://impomatic.blogspot.com.  Emphasis is given to implementing real algorithms in Redcode such as sorting and seaching.

John uses a standard Blogger template, with a post archive and a selection of useful Corewar links in the sidebar.  Usually there are 3 to 4 posts per month.

There are two Corewar related posts.  Parallel Processes describes a useful pMARS macro and An Improved '88 Quick-scanner shows how Paul Kline's technique can be used to create a 48 instruction '88 qscan which scans 36 locations.  The remainder of the blog is devoted to algorithms.

Some posts I found particularly interesting are Comb sortStooge sort and Gnome sort which I hadn't previously heard of.  Apart from sorting, there are implementations of seaching and number theory algorithms.  A post comparing the performance of the different techniques would be an interesting addition.

What I liked:
  • A unique concept
  • The code is well written
Room for improvement:
  • For the more complex code, a detailed description would be nice
  • A few comments would make the code easier to understand