Skip to content

Vulcaaa/Corewar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Corewar

Corewar

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.

About

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.

Features

  • Full Redcode instruction setlive, 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 live in 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)

Build

make          # standard VM
make bonus    # with ncurses visualizer

Usage

./corewar [-dump N] <warrior1.cor> [warrior2.cor] ...
./corewar_bonus warrior1.cor warrior2.cor

Credits

Team project realized as part of the Epitech curriculum — Systems Programming module.

  • Nielsen Combe-Bracciale
  • Mathys Aberkane

About

MARS virtual machine in C: runs Redcode warrior programs in a shared memory arena — the Core War game.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors