A C++ implementation of Nils Aall Barricelli's computational worlds as described in his 1954 paper Esempi Numerici di Processi di Evoluzione. The program regenerates each of the figures shown in the paper.
The source code is a single C++ file barricelli.cpp
that lives in the src
directory. It should be compiled with a C++20 (or later) compiler.
For Linux users, the compile
script in the base directory should
compile the source code for you. The output is an executable file
barricelli54
that lives in the base directory.
Once compiled, the program can be run with the command:
barricelli54 [-c] n
where n
is the figure number to be reproduced, and the -c
flag,
if present, specifies that output should be in CSV format. If the -c
flag is omitted, the output is space-separated and padded so columns
of digits are aligned.
To convert the CSV files generated by the barricelli54
program into
PNG images that match the style of those presented in Barricelli's 1954
paper, the csv2img.py
script is provided in the base directory.
This can be run as follows:
python3 csv2img.py [-b] my_csv_file.csv [label_specs...]
where my_csv_file.csv
is a CSV file such as those generated by
barricelli54
. The -b
flag, if present, specifies that grid lines
should be included in the output. One or more label_specs
can
optionally be specified to print labels above and/or below the
generated image at specified positions. See the csv2img.py
file
for details of usage.
The script produces a PNG file with the same basename as the specified
CSV file (e.g. my_csv_file.png
).
A Bash script gen-figs-with-labels
is provided that generates
Figures 8-11 with the labels as they appear in the 1954 paper.