Code Monkey home page Code Monkey logo

corewar's Introduction

Table of Contents

Introduction

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.

How to play

You can either install corewar on your local machine or go to my self-hosted instance :

Install

# 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

Configuration

All options available from ./corewar.py --help can be added in corewar.cfg file

Run

Corewar can be used as a standalone program to assemble and run ships or as a daemon web-server.

Standalone

  • 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

WebServer

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.