Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Corewar project made at Epitech during april/may 2025 by Axistorm and Arkcadia

Notifications You must be signed in to change notification settings

Axistorm1/Corewar

Repository files navigation

πŸ”₯ Corewar: The Battle of Code

Corewar is a programming game where players write programs, called warriors, that battle for control of a simulated computer memory called the core. The game is a test of logic, strategy, and low-level programming skill.


🧠 How It Works

  • Language: Warriors are written in an assembly-like language called Redcode (this version uses a pseudo-redcode language).
  • Simulator: The game runs in a virtual machine that follows the rules of the MARS (Memory Array Redcode Simulator).
  • Goal: Each warrior tries to:
    • Survive longest in the memory.
    • Crash or disable the opponent's code.
    • Take over the memory by replicating or overwriting other programs.

πŸ’» Game Mechanics

  • The core memory is a circular array where each cell can contain a Redcode instruction.
  • Multiple warriors are loaded into different parts of the core.
  • Warriors execute instructions based on their 'cooldown'.
  • If a warrior runs out of processes, it dies.
  • The last warrior running wins.

Corewar


Table of Contents


Features

✨ Key features:
βœ”οΈ Efficient virtual machine
βœ”οΈ Beautiful graphic version


Installation

Prerequisites:
All available in the install script
Default:

  • Git
  • Make + Cmake
  • GCC + Clang

Graphic version:

  • Raylib
  • Ncurses
  • SDL

Steps:

  1. Clone the repository:
    git clone https://github.com/Axistorm1/Corewar.git --depth=1
  2. Navigate to the project directory:
    cd B-CPE-200-TLS-2-1-corewar-valentin.bort-esgueva
  3. Install dependencies:
    ./installer.sh
  4. Compile project:
    make

Usage

Basic Commands:

./corewar -h
./corewar [-dump nbr_cycle] [[-n prog_number] [-a load_address] prog_name] ...

Examples

./corewar -dump 1000 -n 5 abel.cor -a 2000 bill.cor

Acknowledgements

  • Thanks to Epitech for this wonderful project

⭐ Star this repo if you liked it! ⭐


About

Corewar project made at Epitech during april/may 2025 by Axistorm and Arkcadia

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 2

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /