1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
=== building ===
In order to compile this, you will need GNU Make, GCC, GNU LD, pkg-config, Open MPI, and gtkmm 4.
On Debian, you can install all of these with
apt install make gcc binutils pkg-config openmpi-bin libgtkmm-4.0-dev
On macOS with Homebrew, you can install all of these with
brew install make gcc binutils pkg-config open-mpi gtkmm4
Then, to build all of the software, just run make.
=== core war standard ===
lib94 attempts to follow the draft standard at <https://corewar.co.uk/standards/icws94.txt>, minus P-space. There are no read/write
limits (or if you prefer, they are the same as the core size). The minimum separation is always 0, and the core size is set at 8000.
To change the core size, change LIB94_CORE_SIZE in include/lib94/lib94.hpp, run make clean, and then run make. The maximum number of
processes is set at 16000. To change that, change LIB94_MAX_PROCESSES in include/lib94/lib94.hpp, run make clean, and then run make.
=== bench ===
The "bench" program (short for test bench) is intended for testing out warriors and seeing exactly what they do. It allows you to
single step, or run at a variety of rates. It has a large display which shows core reads/writes/executions as they happen, and a
listing of all of the instructions in the core. It also shows "alive" warriors, their instruction pointer for the next step, and
how many processes they have.
To open bench, just run bin/bench after building as above.
=== tabulator ===
The "tabulator" program runs every possible pairing of warriors from a selection against each other with every possible separation
and turn order, and then shows the number of wins of each warrior against each other warrior in a table format. The column header
is the winner, and the row header is the loser. This program uses MPI to run batches of these rounds in different processes, and
communicate the results back to a head process.
To run all of the included warriors against each other, run
mpirun bin/tabulator-mpi warriors/*.red
Note that tabulator expects at least two processes (one head process and at least one worker). If you only have one core, you may run
mpirun -np 2 --oversubscribe bin/tabulator-mpi warriors/*.red
=== evolver ===
The "evolver" program attempts to create warriors who are good against a particular other warrior via a process similar to genetic
evolution. It is highly experimental and does not always work. I may or may not attempt to improve it in the future.
To evolve a warrior against the included Epson warrior, with the outputs from each round stored in a directory named output, run
bin/evolver warriors/epson.red output
|