Welcome to the CoreWars Evolver home page.
Copyright © 2005-2006, Miha
Vitorovic
Index
1. Introduction
The goal of this project is to develop a
Java Genetic Algorithm redcode warrior evolver. This document provides
some basic information and is split into two parts. It starts with the
user part, followed by a developer part.
2. User information
2.1. Instructions
To run CoreWars you will need Java 5.0.
You may download it from www.java.com.
After you install Java, you may start CoreWars with:
java -jar <JAR archive name> [options]
warriorFile [warriorFile warriorFile ...]
Options:
-e (--debug)
Opens debug window, allows single-stepping, and memory inspection.
-r #
(--rounds) Specify the number of rounds.
-s # (--size)
Specify core size.
-c #
(--max-cycles) Sets the maximum number of cycles per round.
-p #
(--max-processes) Sets the maximum number of processes a warrior can
run. The default is 8000.
-l #
(--length) Sets the maximum length of a warrior source file in
instructions. It defaults to 100 and can be up to 500.
-d #
(--min-distance) Specify minimal distance between warriors.
-S #
(--p-space-size) Specify P-space size.
-F #
(--fixed-address) Install second warrior at fixed address #.
-b (--brief)
This options runs pMARS in brief output mode. It suppresses warrior
listings after assembly.
-= $
(--score-formula) Define a score formula. Default: (W*W-1)/S
2.2. Documentation
Mars interpreter (I hope) finally works
correctly, or at least it runs the "validate.red" warrior (part of pMARS
distribution) the way it should. The interpreter is based on ICWS 94 Proposed
Standard implementation.
It supports all ICWS'94 OpCodes including P-space, and so far the
following meta instructions:
- org <start address>
- end [<start address>]
- ;assert <expression>
- ;name
+ others will be added later
- labels and address arithmetics
- parentheses may be used to change priority
+ operators & priority:
Arithmetic:
+ addition or
unary plus
- subtraction
or unary minus
*
multiplication
/ division
% modulo
(remainder of division)
Comparison:
== equality
!= inequality
< less than
> greater
than
<= less
than or equal
>= greater
than or equal
Logical:
&& and
|| or
! not
Assignment (will be added
later)
= assignment
Comparison and logical
operators return 1 for true and 0 for false. Parentheses can be used to
override this precedence order:
1) ! - + (unary)
2) * / %
3) - + (binary)
4) == != < > <= >=
5) &&
6) ||
7) =
Supports EQU and FOR/ROF loops. The goal was to compile
everything pMARS does, and even some things that it doesn't. The
compiled output may not be character by character the same as with
pMARs, but is functionally equivalent, e.g. you may get '7983' instead
of '-17', for CORESIZE 8000.
