Skip to content

Our own Core War AI champion, assembler, disassembler, and virtual machine in C using ncurses and minilibx. (42 Silicon Valley)

Notifications You must be signed in to change notification settings

ashih42/corewar

Repository files navigation

corewar

Our own Core War AI champion, assembler, disassembler, and virtual machine in C using ncurses and minilibx. (42 Silicon Valley)

(This screenshot shows Player 2 (Chicken) is currently in the lead...)

Objectives

  • AI champion program, e.g. srcs_champ/plagiarism.s
  • Assembler
    • Translate assembly .s to binary .cor
  • Disassembler
    • Reverse-engineer binary .cor to assembly .s
  • Virtual Machine
    • Enforce game rules
    • Render game graphics

Prerequisites

You are on macOS with gcc and make installed.

Compiling

make

Running

Assembler

./asm [ champ1.s ... ]

Disassembler

./disasm [ champ1.cor ... ]

Virtual Machine

The game can start with 1 - 4 players

./corewar [flags] [ champ1.cor ... ]

Flags:

  • -v Enable dual visualizers.
  • -e Enable emoji mode.

Visualizer Controls

(Circular Visualizer window has focus)

  • Right Arrow Step forward 1 cycle.
  • Tab Fast-forward and stop on next cycle-to-die.
  • Spacebar Fast-forward or stop.
  • Up Arrow Increase frame-skip.
  • Down Arrow Decrease frame-skip.
  • Escape Terminate the program.

About

Our own Core War AI champion, assembler, disassembler, and virtual machine in C using ncurses and minilibx. (42 Silicon Valley)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published