Corewar Developer Reference

This area of the docs will provides a technical reference for the corewar npm package.

The Corewar library provides a redcode parser, corewar simulator and hill and benchmark functionality and is used by corewar.io.

The Corewar library provides an API to access the libraries functionality. The library uses a pubsub mechanism to publish messages in resopnse to events within the simulator.

API

The Corewar API is divded into the following sections:

Building

Corewar is written in Typescript packaged using webpack and built by running:

npm build

Testing

Corewar is extensively unit tested using Mocha, Chai, Sinon and sinon-chai. Code coverage is supplied using Istanbul.

Corewar contains unit tests for the Parser, Simulator and Matches APIs along with integration tests for the Parser.

To execute the tests and see code coverage run:

npm test

Unit test debugging is configured to run in VS Code