Showing posts with label redcode. Show all posts
Showing posts with label redcode. Show all posts

Friday, 13 March 2009

nano papers: ghoulish and Apis Mellifera

Here are a couple of nano paper/clear I've been playing with recently using a mov.i #1,<1 anti-imp clear.

;redcode-nano
;name ghoulish
;author S.Fernandes
;strategy paper/clear
;assert CORESIZE == 80

pstep equ -39
cpos equ -18
dpos equ 27

paper spl #-21 , <-32
mov }paper-1 , }pboot
mov.i #1 , <1
pboot spl <pstep , cpos
djn.f paper+1 , <dpos
end


;redcode-nano
;name Apis Mellifera
;author S.Fernandes
;strategy paper/clear
;assert CORESIZE == 80

pstep equ -22
cpos equ -18
dpos equ -8

paper spl #0 , <33
mov }paper , }pboot
pboot spl <pstep , <-16
mov.i #1 , <1
djn paper+1 , #dpos
end

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?

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

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:

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 sort, Stooge 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

Sunday, 8 June 2008

Philip Thorne's Corewar Introduction



Philip Thorne's Corewar Introduction can be found at http://home.pipeline.com/~corewar and has been reporting the latest tournament news since 2002.  The homepage has a handy selection of links for Corewar beginners.

What really make's Phil's site stand out is the unique content.  There are two useful tools, RSS feeds for the KOTH hills and a Redcode syntax definition for VIM.  The RSS feeds are updated daily.

Phil's Stone Analysis article has a thorough examination of 13 stones, comparing everything from speed and coverage to the type of core-clear.  Unfortunately, I didn't understand all of the figures in the table - a key would be helpful.

Finally, Phil has published a selection of warriors.  The layout here is almost perfect!  The warriors are presented in an interactive tree structure and the warrior files are displayed with syntax highlighting.

What I liked:
  • The Stone Analysis article
  • The presentation of warriors
Room for improvement:
  • A key to help interpret the Stone Analysis table

Wednesday, 4 June 2008

Neo's World of Corewar

Germán Labarga completely overhauled his website a few months back with a new URL, new design and updated content. The new location is http://labarga.atspace.com. The new layout is clutter free and easy to navigate.

Neo used to pose a programming challenge in Redcode every couple of weeks, and the results from the Mini Challenges are hosted here. There's also a selection of Neo's published warriors. This section could be improved a little by including some short comments.

The highlight of the site has to be the article documenting P-Key's Development. P-Key is an adaptive switcher which won the Smart Switching tournament round.

What I liked:
  • The results from the Mini Challenges
  • The article about P-Key
Room for improvement:
  • Some brief comments on the warriors page would be nice
  • The tools page needs more links (it currently has only one)

Tuesday, 11 September 2007

ripples in space-time

While looking through the breakdown of nano warriors by strategy I
noticed the absence of a decent 4 line paper, despite the success of
5-liners like Fluffy's Black Sun III. I quickly hacked something up
and added a quick-bomb to the beginning.


I tested with some hand-picked constants against Metcalf's nano
benchmark. It scored 139.2, or 129.8 with the quick-bomb removed.



;redcode-nano
;name hand coded paper
;author S.Fernandes
;strategy paper
;assert CORESIZE == 80

pstep equ 15
ipos equ 40
cpos equ -5
dpos equ 35

mov >60 , 10
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end

Optimization


In the first round of optimization 400 warriors are generated with
all constants randomized. A small script is run over the source
below replacing each exclamation mark with a random number. The
quick-bomb will be disabled until the final stage.



org paper

pstep equ (4+!%73) ; range 4-76
ipos equ (2+!%70) ; range 2-71
cpos equ (8+!%70) ; range 8-77
dpos equ (7+!%70) ; range 7-76

mov >27 , 54
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end

I've use modulo to restrict the range of random values to prevent
self-bombing. This reduces the search space by approximately 40%.
While this may stop some interesting self-mutation or interaction
being found, it's really the author's job not the optimizer's to
discover these.


The peak score is 139.5. Now we take a closer look at the top 10
results to compare the paper step. -17 occurs four times, -18 twice
and -15, -22, -25 and 33 once.


For stage 2 we generate 100 warriors for each of the above paper
steps with all other constants randomized. The peak score is 145.8
with pstep -22 followed by 145.0 with pstep -17.


The top two warriors from stage 2 are taken and their cpos
optimized in stage 3. All 70 values are tested for each warrior.
The peak score for the warrior with pstep -22 remains at
145.8. The score for the warrior with pstep -17 improves
to 145.7.


In stage 4 we take the top warrior for each pstep from
stage 3 and optimize dpos. The scores increase to 146.2
(pstep -22) and 145.8 (pstep -17).


In stage 5 we optimize ipos. The scores go up to 146.8
(pstep -22) and 149.2 (pstep -17).


Finally the quick-bomb is enabled and its two constants optimized.
400 random pair of quick-bomb constants are generated. The final
benchmark scores are 158.3 (pstep -22) and 159.2
(pstep -17).


Submission to SAL's Nano Hill


Although the benchmark scores are impressive, the hill contains 50
completely different warriors. If the benchmark reflects the hill
well, the scores should be within 10%.


The paper with pstep -22 scores 146.2 and takes 6th
place. With pstep -17 however the score is 152.3 and 4th
place.



;redcode-nano
;name ripples in space-time
;author S.Fernandes
;strategy paper
;assert CORESIZE == 80

pstep equ -17
ipos equ 10
cpos equ -33
dpos equ 36

mov >-39 , 25
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end


;redcode-nano
;name ripples 22
;author S.Fernandes
;strategy paper
;assert CORESIZE == 80

pstep equ -22
ipos equ -34
cpos equ 17
dpos equ -29

mov >-38 , 25
paper spl #0 , <pstep
mov }paper , >paper
mov >ipos , <cpos
djn.f *pstep-2 , <dpos
end

Thursday, 26 July 2007

top 10 links for Corewar Newbies

  1. Clueless newbies should begin with Scott's Quick Core War Guide for a brief overview.


  2. Still interested? Then download MARS, the Redcode virtual machine. Recommended are CoreWin for Windows or pMARS for virtually everything else.


  3. Next stop is the Beginner's Guide to Redcode to learn the essentials of '94 Redcode programming.


  4. Confused? The Introduction to Art in '88 is the perfect guide to the basic Corewar strategies.


  5. The Corewar Bibliography is an ideal starting point for further research.


  6. Koenigstuhl contains thousands of published warrior to dissect, study or play against.


  7. When you're ready to join the fun, find out how to submit you warriors to the hills at SAL and KOTH.


  8. Need help? Simply ask in the IRC channel #COREWARS on irc.freenode.net

Thursday, 19 July 2007

nanoWarrior #02 (finally!)

Finally, the latest issue of nanoWarrior is complete! Check it out for yourself here:

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