MY FIRST COREWAR BOOK ------- PREFACE ------- This book is an introductory collection of corewar warriors with commentary. It assumes an acquaintance with the ICWS '88 redcode language (See M.Durham's tutorial.1 and tutorial.2 for details). Unless otherwise noted, all redcode is written in ICWS '88 and is designed for a coresize of 8000, process limit 8000. All documents referred to in this text are available by anonymous FTP at ftp.csua.berkeley.edu in one of the subdirectories of pub/corewar/. After a brief introduction, each chapter presents warriors by subject. I then pontificate on the merits of these various warriors and give some hints for successful implementation. I mention credits and give references to other warriors worth further investigation. Unless otherwise indicated, these warriors are archived in warrior10.tar in the redcode/ directory. The presentation of each warrior follows roughly the same format. First, the parameters of the warrior are given. These include the name, author, attack speed, effective size, durability, and effectiveness, and score against the Pizza Hill. The effective size is the size of the executing code during the attack phase, taking into account regenerative code. Next, self-contained source code is given, followed by a brief description of the warrior. Finally, a detailed technical description of how the warrior runs is given. I hope that this helps. If you have questions or comments, send them to morrell@math.utah.edu, where you can reach me until June,1994 Steven Morrell --------------------- Chapter 1: Imp-Rings --------------------- On October 14, 1992, A.Ivner posted a warrior that revolutionized the game of corewar. "The IMPire strikes back" scored about 170 on the Intel hill and only suffered 10% losses, putting it firmly in first place. A.Ivner had invented a way to kill other programs with imps -- the world's first imp-ring. D.Nabutovsky improved the launch code a bit by making an imp-spiral and adding a stone in his "Impressive", which lost only 2% and scored 195 when it started on the hill (for more information on stones, see chapter 2). Since that time, most warriors on the hill have either been imps or something hostile to imps. This chapter deals with imps, from the basic imp proposed by A.K.Dewdney in the original Scientific American articles to the modern-day imp-spiral we see as a component of many successful warriors. --1-- Name: Wait Speed: None Size: 1 Durability: Strong Effectiveness: None Score: wait JMP wait end wait Wait is the simplest warrior. Its small size makes it difficult to locate. However, it has no attack, so it only wins if the enemy program self-destructs. We shall be using this program for fodder. --2-- Name: Imp Author: A.K.Dewdney Speed: 100% of c (sequential) Size: 1 Durability: Strong Effectiveness: Poor Score: imp MOV imp, imp+1 end imp Imp presents the enemy with a small, moving target that will not die without a direct hit. It ties a lot, and is vulnerable to the imp-gate. (See program 3) HOW IT WORKS: When Imp is loaded and before it executes, it looks like this: MOV 0,1 (1) (The (1) shows which instruction will execute on the first cycle.) When process (1) executes, it first copies its instruction to the next address and then moves to the next instruction: MOV 0,1 ;This is the original. MOV 0,1 (2) ;This is the copy. Process (2) now executes. Since all addressing is relative, the process copies its instruction to the next address and advances. MOV 0,1 MOV 0,1 MOV 0,1 (3) ;This is the second copy. And so it goes, overwriting anything in its path with MOV 0,1 instructions. So when it encounters enemy code, it replaces the enemy code with MOV 0,1 instructions, turning the enemy processes into imps. Note that although the enemy code is gone, the enemy processes live on, so imps do not win unless the enemy code self-destructs. --3-- Name: Imp Gate Speed: None Size: 1 Durability: Strong Effectiveness: Excellent against imps, Extremely Poor against others Score: gate equ wait-10 wait JMP wait,