Table of Contents
Corewar is a coding game where programs confront each others in a virtual machine. Coded in a asm-like language, your program is assembled as a ship that races a cycling memory. Each instructions cost a certain amount of CPU cycle, the fastest ship to complete 3 laps wins.
You can either install corewar on your local machine or go to my self-hosted instance :
- http://corewar.marcelet.com/rules/ (French documentation)
# install dependencies
sudo apt-get install mysql-server python-mako python-ply python-cherrypy python-mysqldb
# checkout from git repo
git clone https://github.com/psycofdj/corewar.git
# enter corewar directory
cd corewar/src
# create default configuration
cp corewar.cfg.sample corewar.cfg
# bootstrap database
# -> it will prompt for mysql admin user/pass
# -> and creates new database and user according to corewar.cfg
./setup.py --install --modules=corewar
All options available from ./corewar.py --help
can be added in corewar.cfg file
Corewar can be used as a standalone program to assemble and run ships or as a daemon web-server.
- compile ship : this command checks your code in file my_ship.s and output errors if any
./corewar.py --league=race --check-compile my_ship.s
- run ship : this command compiles and run your code in file my_ship.s
./corewar.py --league=race my_ship.s
you can add executions logs (to debug you ship) with the --log-level switch.
./corewar.py --league=race my_ship.s --log-level=10
First run :
./corewar.py --web-start
Then go to http://localhost:8080
Ports and logs options can be specified from command line or corewar.cfg.