Two programs fight in a shared memory arena. The last one standing wins. Welcome to Core War — a 1984 programming game where warriors written in Redcode battle inside a virtual machine called MARS.
A MARS virtual machine implemented from scratch in C, loading and running Redcode warrior programs in a shared 6 KB arena. Includes a ncurses visualizer to watch the battle in real time.
- Full Redcode instruction set —
live,ld,st,add,sub,and,or,xor,zjmp,ldi,sti,fork,lld,lldi,lfork,aff - Circular 6 KB memory arena, 16 registers per process, big-endian byte handling
- Multi-process execution — warriors can
fork; all processes run concurrently - Cycle-to-die — processes that don't report
livein time are killed -dump N— print the full memory state after N cycles- Bonus: ncurses visualizer — real-time color display of the arena (
make bonus)
make # standard VM
make bonus # with ncurses visualizer./corewar [-dump N] <warrior1.cor> [warrior2.cor] ...
./corewar_bonus warrior1.cor warrior2.corTeam project realized as part of the Epitech curriculum — Systems Programming module.
- Nielsen Combe-Bracciale
- Mathys Aberkane
